Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice
  2. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  3. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Help Wanted [XR] Some problems about controllers in gameplay

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

  1. ixmas93

    ixmas93

    Joined:
    Mar 16, 2020
    Posts:
    6
    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

    Louisicraft

    Joined:
    Jun 27, 2020
    Posts:
    2
    same question, have you found anything about it?
     
unityunity