cancel
Showing results for 
Search instead for 
Did you mean: 

OVRGrabber and handling doors (Unity)

nr100
Honored Guest
Hi,

I'm quite new to the world of game development and C#. I've recently started out and use the Oculus SDK exclusively (without the use of SteamVR/VRTK/NewtonVR).

I'm trying to create a door, which I can open and pivot by the door handle (where you can either push/pull to move them). Does anyone have a good example for this or some basic instructions on how to achieve it? I've managed to have a basic OVRGrabber where I can pick up objects, throw them away, open things by pressing on a button (using OVRInput).

My thinking is that I will need to do some sort of distance check from the door handle and the player hand(s), snap onto the door handle, then depending on the z-axis movement I should open or close the door using a lerp effect (within certain boundaries). I've not tried this, but this is what I "think". Unless there's some physics/rigidbody way of doing it? I'm also confused how I can ensure that the user doesn't accidentally "pick up" the door instead (I suspect the entire door movement will have to be scripted, no interaction with physics by using isKinematic/isTrigger).

Thanks in advance
0 REPLIES 0