Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question [XR] Some problems about controllers in gameplay

Discussion in 'AR/VR (XR) Discussion' started by ixmas93, Jul 30, 2020.

  1. ixmas93


    Mar 16, 2020
    Hello everybody im learning VR on Unity XR Interaction toolkit and i have some doubts. I hope some of you could help me :)

    -Check what object im grabbing and what hand

    -How to force the player to drop the object he is grabbing in one of his hands

    - Have different actions on the object that the player holds according to the button that the player presses. This needs an example:

    I have a gun that I can grab and using the "OnActive" event it fires. But I want to be able to do more things with the rest of the buttons. For example, pressing button A causes the magazine to exit the gun, but there are no events for the other buttons.

    What is the best way to do this? Have the gun script check in the Update what input is being pressed?

    Thanks so much in advance :)
  2. Louisicraft


    Jun 27, 2020
    same question, have you found anything about it?