cancel
Showing results for 
Search instead for 
Did you mean: 

how to check if object is grabbed by specific controller?

tkdHayk
Protege
Below is pseudo-code which demonstrates my desired functionality. The code needs to be placed in on the grabbed object. The part in Bold is what I need clarification on. 

if (_OVRGrabbable.grabbedBy == "LTouch")
{
//Do something
}

EDIT:

Solution :

Public OVRGrabber LeftGrabber; // Drag grabber to inspector field

if (_OVRGrabbable.grabbedBy == LeftGrabber)
{
//Do something
}


2 REPLIES 2

peiqi_tang
Honored Guest
+1. Also trying to figure out.

peiqi_tang
Honored Guest
I figured it out.
You can check the static float from OVRInput.Get(Axis.1D.PrimaryHandTrigger, OVRInput.Controller.LTouch), 0 is not pressed, 1 is pressed to the end.