Create a lever on an object activated by grabbing. Lever’s need to move from a pivot position properly so ensure this is set up properly (VR Grabbables & Unity Joints)
Lever Hinge
Gameobject contains the Hinge Joint and VR Grabbable logic.
Collider
If possible use a primative collider, unless you’re sure the user may only grab the object on the lever handle alone.
Field | Value |
---|---|
Trigger | Generally true unless this item needs physics |
Rigidbody
Field | Value |
---|---|
Use Gravity | false |
Is Kinematic | true |
Collision Detection | Continuous Speculative |
Hinge Joint
Field | Value |
---|---|
Axis + Secondary axis | Adjust identity matrix to pivot on desired axis. |
Connected Rigidbody | Rigidbody of main/body object |
Limit Rotation | true |
Usable World Object
Required to connect to the “use object” input for object interactions.
Field | Value |
---|---|
On Use | Connect to any animations, SFX, etc. required for the action. |
Motive Scene Object
Required for Scene Objects, can be skipped if deploying as an asset.
User Click Action
Connects to “Usable World Action” to relay the “click” action.
User Touch Action
Connects to “Usable World Action” to relay the “touch” action.
Pointer Events
Use these to wire up finer-grained actions (such as action on down instead of click, etc).