Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
wheatgrinder's avatar
wheatgrinder
Explorer
10 years ago

Practical UNITY \ VR Dev Tricks

While developing for the DK2 Iv gotten proficient at holding the DK2 up in one hand and moving the character with the keyboard\gamepad with the other hand. I can get a quick test of changes to my game without donning the HMD.

Anybody else have interesting tips or tricks to working with the DK2 for long hours in the real world?

Im half tempted to mount the DK2 to a welders mask so I can flip it up and down quickly.. lol

2 Replies

Replies have been turned off for this discussion
  • That idea on the welder's mask.
    Not bad at all. Great idea actually.
    Keep up these hints of yours!
    Thanks.
  • DEV TRICK: Map RECENTER to the XBox Controller

    I map the Recenter position tracking to XBox Controller Right Joystick button then I don't need to find the keyboard when it's out of reach.

    Here's my script:

    // Recenter input mapping for VR by Peter Koch <peterept@gmail.com>
    using UnityEngine;
    using UnityEngine.VR;
    using System.Collections;

    // To use:
    // 1. Drag this script onto any game object
    // 2. Map "Recenter" in the input manager to use XBox Right Joystick Button and 'r' key:
    // Ref: http://blogs.msdn.com/b/nathalievangelist/archive/2014/12/16/joystick-input-in-unity-using-xbox360-controller.aspx
    // Edit -> Project Settings -> Input, and insert a new item and name it "Recenter":
    // Positive Button: "r"
    // Alt Positive Button: "joystick button 9"
    // Type: Key or mouse button
    public class VRRecenter : MonoBehaviour
    {
    void Update ()
    {
    if (Input.GetButtonDown("Recenter"))
    {
    Debug.Log("VR Recenter");
    InputTracking.Recenter();
    }
    }
    }