Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Translating HMD Movement into Input to Move Game Object

Discussion in 'VR' started by AtomDan, May 15, 2018.

  1. AtomDan

    AtomDan

    Joined:
    Jun 14, 2013
    Posts:
    1
    What I'm trying to do:
    Use the HMD (Samsung Odyssey in my case) as an input source to move a game object.

    Assuming a seated position, I want to take a "leaning action" (eg - with the waist acting as the pivot point, the user leans their body to the left or right) and translate that in-game to a "strafing" input.

    So when the user leans to the left, the game object will strafe left. Lean right, the game object will strafe right in an analog / joystick like fashion.

    What I don't understand:
    I can't seem to figure out how to read HDM input beyond the use of Gaze. In the Unity input documentation ( https://docs.unity3d.com/ScriptReference/XR.InputTracking.html ), I'm seeing a reference to "nodes" but I'm not sure if these are hardware specific, or where to find out what nodes I would need to reference, as they ask for a "specific node" to be referenced in code.

    Do I need to use GetNodeStates to try and obtain a list of the hardware's nodes, to then reference them dynamically later in the script? Is there a set list of nodes somewhere I'm just not finding? Am I dumb, and this isn't even the right direction in general?

    As a side note - I'm not a programmer by trade, I'm just an artist/designer, so my understanding of C# is extremely basic, so this may just be some incredibly simple thing that is going over my head. Apologies in advance if that is the case.

    Any and all help is greatly appreciated!

    (Headset: Samsung Odyssey, Unity: 2018.1.0f2)