/Scripts/Core/Grabbable.cs
The Grabbable Component let's Grabbers know how and when they can be picked up. There are many properties and events to help you customize it's functionality to your liking.
All you need for a Grabbable object to be picked up is a collider, the Grabbable component, and a RigidBody. Check out this tutorial for setting up a Grabbable object from scratch.
The Grabbable component is a core component of VRIF that contains many customizable properties to get the object to respond how you want it to. Additionally, some properties are only shown depending on the settings shown. So these screenshots and descriptions may not always be up to date. Be sure to check out this component in Unity for the most current tooltips and options.
Below are some properties from version 1.5 :
Not all property descriptions are listed below. See the Grabbable component inside the Unity Editor for a full list of properties and tooltips.
Remote Grabbing True if the object is currently being moved towards a Grabber
Grab Button This property allows you to specify which button needs to be pressed to pick up the object. Typically this would be Grip, but sometimes you may want to use Trigger (like an arrow, for example).
Grab Physics Allows you to specify how this object will be held in the Grabbers
Physics Joint A ConfigurableJoint will be connect from the Grabber to the Grabbable. This allows held objects to still collide with the environment and not move through walls / other objects. The joints rigidity will be tweaked depending on what it is colliding with, in order to make sure it aligns properly with the hands during interaction and movement.
Kinematic The Grabbable will be moved to the Grabber and it's RigidBody will be set to Kinematic. The Grabbable will not allow collision from other objects and can go through walls. The object will remain firmly in place and is a reliable way of picking up objects if you don't need physical support.
Velocity The Grabbable object will be moved using a constant velocity force applied in FixedUpdate.
None No grab mechanism will be applied. Climbable objects are not grabbed to the user, for example. They remain in place when grabbed. No Rigidbody is necessary in this case.
Grab Mechanic Specify how the object is held in the hand / Grabber
Precise The Grabbable can be picked up anywhere
Snap The Grabbable will snap to the position of the Grabber, offset by by any Grab Points that have been specified..
Grab Speed How fast the Grabbable will Lerp to the Grabber when it is being grabbed.
Throw Force Multiplier Angular The Grabbable's Velocity will be multiplied times this when dropped / thrown.
Throw Force Multiplier The Grabbable's Angular Velocity will be multiplied times this when dropped / thrown.
Remote Grabbable If true the object will be eligible to be picked up from far away. Remote Grabbables are found by being within a RemoteGrabber Trigger.
Remote Grab Distance If "Remote Grabbable" is true, then the object can be remote grabbed at a maximum of this distance.
Hide Hand Graphics If true, the Grabber's hand graphics will be hidden while holding this object.
Parent to Hands If true, the object will be parented to the hand / Grabber object. If false, the parent will remain null / untouched. You typically want to parent the object to the hand / Grabber if you want it to move smoothly with the character.
Parent Hand Model If true, the Grabber's Hand Model will be parented to the Grabbable. This means the Grabber and it's Hand Graphics will be independent. Enable this option if you always want the hands to match with the grabbable, even if the hands don't align with the controller. See the demo scene weapon for examples.
Break Distance Drop the item if object's center travels this far from the Grabber's Center (in meters). Set to 0 to disable distance break.
Other Grabbable Must be Grabbed If this is not null, then the specified object must be held in order for this Grabbable to be valid. A weapon clip / magazine inside of a gun is a good example. You may only want the magazine to be grabbable if the pistol is being held.
Secondary Grab What to do if another grabber grabs this while equipped. DualGrab is currently unsupported.
Grab Points A list of Grab Points that determine where the object will be placed in the hand.