Search Unity

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

I want to grab a weapon and shoot

Discussion in 'AR/VR (XR) Discussion' started by antonioanime96, May 2, 2020.

  1. antonioanime96

    antonioanime96

    Joined:
    Feb 16, 2020
    Posts:
    1
    Hi, i have been trying to grab a gun and shoot in my proyect but i cant, im new in programing so i need your help to learn.
    Im using the 2018.4.15f1 version of unity, an oculus quest with virtual descktop and the asset oculus integration
    Im using a prefab of a gun that i can grab with my hands with the components grabbable and grabber, but i made a script for shooting when i grabb the gun but isnt working, i use this if:
    " if ( OVRInput.Get(OVRInput.Button.SecondaryHandTrigger)) "
    When grabber is active it isnt working, but if grabber is disabled is working so, anyone knows how to fix it, or to be hable to tell the script that i want to shoot when the weapon is grabbed?