Search Unity

Unity Virtual Reality: Question about input

Discussion in 'AR/VR (XR) Discussion' started by unity_CmzqIOgMRopC4Q, Apr 9, 2019.

  1. unity_CmzqIOgMRopC4Q

    unity_CmzqIOgMRopC4Q

    Joined:
    Apr 5, 2019
    Posts:
    13
    What I am trying to achieve at this point, is the following: Let's say that we have a Cube game object and a SteamVR player. The Cube object is on position y = 100 and the SteamVR player is on position y = 0.

    I want to make it possible that the player can zoom in on the game object by doing the following:

    -> Pressing both triggers and bringing the controllers close to each other will zoom in.

    -> Pressing both triggers and bringing the controllers away from each other will zoom out.

    I think u understand the effect that I want to create.

    For my project I am using the SteamVR Unity plugin.

    Could someone say me if this is possible and give me some insight on how to do this?

    Thanks in forward.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Of course it's possible. You will just need to monitor the state of the triggers, and the distance between the controllers, and write some code that moves the player forward/backward accordingly.