VR Interaction Framework v2.0
Loading...
Searching...
No Matches
BNG.Grabbable Class Reference

An object that can be picked up by a Grabber. More...

Inheritance diagram for BNG.Grabbable:
BNG.Climbable

Public Member Functions

virtual void Update ()
 
virtual void FixedUpdate ()
 
virtual Vector3 GetGrabberWithGrabPointOffset (Grabber grabber, Transform grabPoint)
 
virtual Quaternion GetGrabberWithOffsetWorldRotation (Grabber grabber)
 
virtual bool IsGrabbable ()
 Is this object able to be grabbed. Does not check for valid Grabbers, only if it isn't being held, is active, etc.
 
virtual void UpdateRemoteGrab ()
 
virtual void CheckRemoteGrabLinear ()
 
virtual void CheckRemoteGrabVelocity ()
 
virtual void InitiateFlick ()
 
Vector3 GetVelocityToHitTargetByTime (Vector3 startPosition, Vector3 targetPosition, Vector3 gravityBase, float timeToTarget)
 
virtual void CheckRemoteGrabFlick ()
 
virtual void UpdateFixedJoints ()
 
virtual void UpdatePhysicsJoints ()
 
virtual Vector3 GetGrabberVector3 (Grabber grabber, bool isSecondary)
 
virtual Quaternion GetGrabberQuaternion (Grabber grabber, bool isSecondary)
 
Vector3 GetGrabbersAveragedPosition ()
 Get the estimated world position of the grabber(s) holding this object. Position factors in 2-Handed grabbing options.
 
Quaternion GetGrabbersAveragedRotation ()
 
virtual void UpdateKinematicPhysics ()
 
virtual void UpdateVelocityPhysics ()
 
Transform GetGrabPoint ()
 
virtual void GrabItem (Grabber grabbedBy)
 
virtual void GrabRemoteItem (Grabber grabbedBy)
 
virtual void ResetGrabbing ()
 
virtual void DropItem (Grabber droppedBy, bool resetVelocity, bool resetParent)
 
virtual void DropItem (Grabber droppedBy)
 
virtual void DropItem (bool resetVelocity, bool resetParent)
 
void ResetScale ()
 
void ResetParent ()
 
void UpdateOriginalParent (Transform newOriginalParent)
 
void UpdateOriginalParent ()
 
ControllerHand GetControllerHand (Grabber g)
 
virtual Grabber GetPrimaryGrabber ()
 Returns the Grabber that first grabbed this item. Return null if not being held.
 
virtual Grabber GetClosestGrabber ()
 Get the closest valid grabber.
 
virtual Transform GetClosestGrabPoint (Grabber grabber)
 
virtual void Release (Vector3 velocity, Vector3 angularVelocity)
 Throw the object by applying velocity.
 
virtual bool IsValidCollision (Collision collision)
 
virtual bool IsValidCollision (Collider col)
 
virtual void parentHandGraphics (Grabber g)
 
virtual BNGPlayerController GetBNGPlayerController ()
 A BNGPlayerController is optional, but if one is available we can check the last moved time in order to strengthen the physics joint during quick movements. This helps prevent jitter or flying objects in certain situations.
 
virtual void RequestSpringTime (float seconds)
 Request the Grabbable to use a springy joint for the next X seconds.
 
virtual void AddValidGrabber (Grabber grabber)
 
virtual void RemoveValidGrabber (Grabber grabber)
 
virtual void SubscribeToMoveEvents ()
 Subscribe to any movement-related events that might cause our Grabbable to suddenly move far away. By subscribing to these events before they occur we can then respond better to these positional updates.
 
virtual void UnsubscribeFromMoveEvents ()
 
virtual void LockGrabbable ()
 
virtual void LockGrabbableWithRotation ()
 
virtual void RequestLockGrabbable ()
 
virtual void RequestUnlockGrabbable ()
 
virtual void ResetLockResets ()
 
virtual void LockGrabbable (bool lockPosition, bool lockRotation, bool overridePriorLock)
 Keep the Grabbable's position and /or rotation in place.
 
virtual void UnlockGrabbable ()
 Allow the Grabbable to move.
 

Public Attributes

bool BeingHeld = false
 Is this object currently being held by a Grabber.
 
GrabButton GrabButton = GrabButton.Inherit
 Configure which button is used to initiate the grab.
 
HoldType Grabtype = HoldType.Inherit
 'Inherit' will inherit this setting from the Grabber. 'Hold' requires the user to hold the GrabButton down. 'Toggle' will drop / release the Grabbable on button activation.
 
GrabPhysics GrabPhysics = GrabPhysics.Velocity
 Kinematic Physics locks the object in place on the hand / grabber. PhysicsJoint allows collisions with the environment.
 
GrabType GrabMechanic = GrabType.Precise
 Snap to a location or grab anywhere on the object.
 
float GrabSpeed = 15f
 How fast to Lerp the object to the hand.
 
bool RemoteGrabbable = false
 Can the object be picked up from far away. Must be within RemoteGrabber Trigger.
 
RemoteGrabMovement RemoteGrabMechanic = RemoteGrabMovement.Linear
 
float RemoteGrabDistance = 2f
 Max Distance Object can be Remote Grabbed. Not applicable if RemoteGrabbable is false.
 
float ThrowForceMultiplier = 2f
 Multiply controller's velocity times this when throwing.
 
float ThrowForceMultiplierAngular = 1.5f
 Multiply controller's angular velocity times this when throwing.
 
float BreakDistance = 0
 Drop the item if object's center travels this far from the Grabber's Center (in meters). Set to 0 to disable distance break.
 
bool HideHandGraphics = false
 Enabling this will hide the Transform specified in the Grabber's HandGraphics property.
 
bool ParentToHands = false
 Parent this object to the hands for better stability. Not recommended for child grabbers.
 
bool ParentHandModel = true
 If true, the hand model will be attached to the grabbed object.
 
bool SnapHandModel = true
 
bool CanBeDropped = true
 Set to false to disable dropping. If false, will be permanently attached to whatever grabs this.
 
bool CanBeSnappedToSnapZone = true
 Can this object be snapped to snap zones? Set to false if you never want this to be snappable. Further filtering can be done on the SnapZones.
 
bool ForceDisableKinematicOnDrop = false
 
bool InstantMovement = false
 
bool MakeChildCollidersGrabbable = false
 
HandPoseType handPoseType = HandPoseType.HandPose
 
HandPose SelectedHandPose
 
HandPoseId CustomHandPose = HandPoseId.Default
 Animator ID of the Hand Pose to use.
 
OtherGrabBehavior SecondaryGrabBehavior = OtherGrabBehavior.None
 What to do if another grabber grabs this while equipped. DualGrab is currently unsupported.
 
TwoHandedPositionType TwoHandedPosition = TwoHandedPositionType.Lerp
 
float TwoHandedPostionLerpAmount = 0.5f
 
TwoHandedRotationType TwoHandedRotation = TwoHandedRotationType.Slerp
 
float TwoHandedRotationLerpAmount = 0.5f
 
TwoHandedDropMechanic TwoHandedDropBehavior = TwoHandedDropMechanic.Drop
 
TwoHandedLookDirection TwoHandedLookVector = TwoHandedLookDirection.Horizontal
 
float SecondHandLookSpeed = 40f
 
Grabbable SecondaryGrabbable
 
Grabbable OtherGrabbableMustBeGrabbed = null
 The Grabbable can only be grabbed if this grabbable is being held. Example : If you only want a weapon part to be grabbable if the weapon itself is being held.
 
float CollisionSpring = 3000
 How much Spring Force to apply to the joint when something comes in contact with the grabbable A higher Spring Force will make the Grabbable more rigid.
 
float CollisionSlerp = 500
 How much Slerp Force to apply to the joint when something is in contact with the grabbable.
 
ConfigurableJointMotion CollisionLinearMotionX = ConfigurableJointMotion.Free
 
ConfigurableJointMotion CollisionLinearMotionY = ConfigurableJointMotion.Free
 
ConfigurableJointMotion CollisionLinearMotionZ = ConfigurableJointMotion.Free
 
ConfigurableJointMotion CollisionAngularMotionX = ConfigurableJointMotion.Free
 
ConfigurableJointMotion CollisionAngularMotionY = ConfigurableJointMotion.Free
 
ConfigurableJointMotion CollisionAngularMotionZ = ConfigurableJointMotion.Free
 
bool ApplyCorrectiveForce = true
 
float MoveVelocityForce = 3000f
 
float MoveAngularVelocityForce = 90f
 
float LastGrabTime
 Time in seconds (Time.time) when we last grabbed this item.
 
float LastDropTime
 Time in seconds (Time.time) when we last dropped this item.
 
bool AddControllerVelocityOnDrop = true
 Set to True to throw the Grabbable by applying the controller velocity to the grabbable on drop. Set False if you don't want the object to be throwable, or want to apply your own force manually.
 
List< Collider > collisions
 
GrabPoint ActiveGrabPoint
 Returns the active GrabPoint component if object is held and a GrabPoint has been assigneed.
 
Vector3 SecondaryLookOffset
 
Transform SecondaryLookAtTransform
 
Transform LocalOffsetTransform
 
List< Transform > GrabPoints
 If Grab Mechanic is set to Snap, the closest GrabPoint will be used. Add a SnapPoint Component to a GrabPoint to specify custom hand poses and rotation.
 
bool UseCustomInspector = true
 Set this to false if you need to see Debug field or don't want to use the custom inspector.
 
float lastFlickTime
 
float FlickForce = 1f
 

Protected Member Functions

void Awake ()
 
void positionHandGraphics (Grabber g)
 
virtual void setupConfigJointGrab (Grabber grabbedBy, GrabType grabType)
 
virtual void setupFixedJointGrab (Grabber grabbedBy, GrabType grabType)
 
virtual void setupKinematicGrab (Grabber grabbedBy, GrabType grabType)
 
virtual void setupVelocityGrab (Grabber grabbedBy, GrabType grabType)
 
Vector3 getRemotePosition (Grabber toGrabber)
 
Quaternion getRemoteRotation (Grabber grabber)
 

Protected Attributes

List< GrabberheldByGrabbers
 The grabber that is currently holding us. Null if not being held.
 
bool wasKinematic
 Save whether or not the RigidBody was kinematic on Start.
 
bool usedGravity
 
CollisionDetectionMode initialCollisionMode
 
RigidbodyInterpolation initialInterpolationMode
 
bool remoteGrabbing
 
HandPoseType initialHandPoseType
 
HandPose initialHandPose
 
HandPoseId initialHandPoseId
 
Transform primaryGrabOffset
 If Grab Mechanic is set to Snap, set position and rotation to this Transform on the primary Grabber.
 
Transform secondaryGrabOffset
 
Transform originalParent
 
InputBridge input
 
ConfigurableJoint connectedJoint
 
Vector3 previousPosition
 
float lastItemTeleportTime
 
bool recentlyTeleported
 
Collider col
 
Rigidbody rigid
 
Grabber flyingTo
 
List< GrabbableEventsevents
 
bool didParentHands = false
 

Properties

bool BeingHeldWithTwoHands [get]
 Is this object currently being held by more than one Grabber.
 
List< GrabberHeldByGrabbers [get]
 
bool RemoteGrabbing [get]
 Is the object being pulled towards the Grabber.
 
Vector3 OriginalScale [get]
 
float lastCollisionSeconds [get, protected set]
 
float lastNoCollisionSeconds [get, protected set]
 How many seconds we've gone without collisions.
 
bool RecentlyCollided [get]
 Have we recently collided with an object.
 
float requestSpringTime [get, protected set]
 
Vector3 GrabPositionOffset [get]
 
Vector3 GrabRotationOffset [get]
 
Transform grabTransform [get]
 
Transform grabTransformSecondary [get]
 
bool CanBeMoved [get]
 Can the object be moved towards a Grabber. Levers, buttons, doorknobs, and other types of objects cannot be moved because they are attached to another object or are static.
 
BNGPlayerController player [get]
 If a BNGPlayerController is provided we can check for player movements and make certain adjustments to physics.
 
Grabber FlyingToGrabber [get]
 
bool DidParentHands [get]
 

Detailed Description

An object that can be picked up by a Grabber.

Member Function Documentation

◆ AddValidGrabber()

virtual void BNG.Grabbable.AddValidGrabber ( Grabber  grabber)
virtual

◆ Awake()

void BNG.Grabbable.Awake ( )
protected

◆ CheckRemoteGrabFlick()

virtual void BNG.Grabbable.CheckRemoteGrabFlick ( )
virtual

◆ CheckRemoteGrabLinear()

virtual void BNG.Grabbable.CheckRemoteGrabLinear ( )
virtual

◆ CheckRemoteGrabVelocity()

virtual void BNG.Grabbable.CheckRemoteGrabVelocity ( )
virtual

◆ DropItem() [1/3]

virtual void BNG.Grabbable.DropItem ( bool  resetVelocity,
bool  resetParent 
)
virtual

◆ DropItem() [2/3]

virtual void BNG.Grabbable.DropItem ( Grabber  droppedBy)
virtual

Reimplemented in BNG.Climbable.

◆ DropItem() [3/3]

virtual void BNG.Grabbable.DropItem ( Grabber  droppedBy,
bool  resetVelocity,
bool  resetParent 
)
virtual

◆ FixedUpdate()

virtual void BNG.Grabbable.FixedUpdate ( )
virtual

◆ GetBNGPlayerController()

virtual BNGPlayerController BNG.Grabbable.GetBNGPlayerController ( )
virtual

A BNGPlayerController is optional, but if one is available we can check the last moved time in order to strengthen the physics joint during quick movements. This helps prevent jitter or flying objects in certain situations.

Returns

◆ GetClosestGrabber()

virtual Grabber BNG.Grabbable.GetClosestGrabber ( )
virtual

Get the closest valid grabber.

Returns
Returns null if no valid Grabbers in range

◆ GetClosestGrabPoint()

virtual Transform BNG.Grabbable.GetClosestGrabPoint ( Grabber  grabber)
virtual

◆ GetControllerHand()

ControllerHand BNG.Grabbable.GetControllerHand ( Grabber  g)

◆ GetGrabberQuaternion()

virtual Quaternion BNG.Grabbable.GetGrabberQuaternion ( Grabber  grabber,
bool  isSecondary 
)
virtual

◆ GetGrabbersAveragedPosition()

Vector3 BNG.Grabbable.GetGrabbersAveragedPosition ( )

Get the estimated world position of the grabber(s) holding this object. Position factors in 2-Handed grabbing options.

Returns
World position og the grabber, with two handed behavior factored in.

◆ GetGrabbersAveragedRotation()

Quaternion BNG.Grabbable.GetGrabbersAveragedRotation ( )

◆ GetGrabberVector3()

virtual Vector3 BNG.Grabbable.GetGrabberVector3 ( Grabber  grabber,
bool  isSecondary 
)
virtual

◆ GetGrabberWithGrabPointOffset()

virtual Vector3 BNG.Grabbable.GetGrabberWithGrabPointOffset ( Grabber  grabber,
Transform  grabPoint 
)
virtual

◆ GetGrabberWithOffsetWorldRotation()

virtual Quaternion BNG.Grabbable.GetGrabberWithOffsetWorldRotation ( Grabber  grabber)
virtual

◆ GetGrabPoint()

Transform BNG.Grabbable.GetGrabPoint ( )

◆ GetPrimaryGrabber()

virtual Grabber BNG.Grabbable.GetPrimaryGrabber ( )
virtual

Returns the Grabber that first grabbed this item. Return null if not being held.

Returns

◆ getRemotePosition()

Vector3 BNG.Grabbable.getRemotePosition ( Grabber  toGrabber)
protected

◆ getRemoteRotation()

Quaternion BNG.Grabbable.getRemoteRotation ( Grabber  grabber)
protected

◆ GetVelocityToHitTargetByTime()

Vector3 BNG.Grabbable.GetVelocityToHitTargetByTime ( Vector3  startPosition,
Vector3  targetPosition,
Vector3  gravityBase,
float  timeToTarget 
)

◆ GrabItem()

virtual void BNG.Grabbable.GrabItem ( Grabber  grabbedBy)
virtual

Reimplemented in BNG.Climbable.

◆ GrabRemoteItem()

virtual void BNG.Grabbable.GrabRemoteItem ( Grabber  grabbedBy)
virtual

◆ InitiateFlick()

virtual void BNG.Grabbable.InitiateFlick ( )
virtual

◆ IsGrabbable()

virtual bool BNG.Grabbable.IsGrabbable ( )
virtual

Is this object able to be grabbed. Does not check for valid Grabbers, only if it isn't being held, is active, etc.

Returns

◆ IsValidCollision() [1/2]

virtual bool BNG.Grabbable.IsValidCollision ( Collider  col)
virtual

◆ IsValidCollision() [2/2]

virtual bool BNG.Grabbable.IsValidCollision ( Collision  collision)
virtual

◆ LockGrabbable() [1/2]

virtual void BNG.Grabbable.LockGrabbable ( )
virtual

◆ LockGrabbable() [2/2]

virtual void BNG.Grabbable.LockGrabbable ( bool  lockPosition,
bool  lockRotation,
bool  overridePriorLock 
)
virtual

Keep the Grabbable's position and /or rotation in place.

◆ LockGrabbableWithRotation()

virtual void BNG.Grabbable.LockGrabbableWithRotation ( )
virtual

◆ parentHandGraphics()

virtual void BNG.Grabbable.parentHandGraphics ( Grabber  g)
virtual

◆ positionHandGraphics()

void BNG.Grabbable.positionHandGraphics ( Grabber  g)
protected

◆ Release()

virtual void BNG.Grabbable.Release ( Vector3  velocity,
Vector3  angularVelocity 
)
virtual

Throw the object by applying velocity.

Parameters
velocityHow much velocity to apply to the grabbable. Multiplied by ThrowForceMultiplier
angularVelocityHow much angular velocity to apply to the grabbable.

◆ RemoveValidGrabber()

virtual void BNG.Grabbable.RemoveValidGrabber ( Grabber  grabber)
virtual

◆ RequestLockGrabbable()

virtual void BNG.Grabbable.RequestLockGrabbable ( )
virtual

◆ RequestSpringTime()

virtual void BNG.Grabbable.RequestSpringTime ( float  seconds)
virtual

Request the Grabbable to use a springy joint for the next X seconds.

Parameters
secondsHow many seconds to make the Grabbable springy.

◆ RequestUnlockGrabbable()

virtual void BNG.Grabbable.RequestUnlockGrabbable ( )
virtual

◆ ResetGrabbing()

virtual void BNG.Grabbable.ResetGrabbing ( )
virtual

◆ ResetLockResets()

virtual void BNG.Grabbable.ResetLockResets ( )
virtual

◆ ResetParent()

void BNG.Grabbable.ResetParent ( )

◆ ResetScale()

void BNG.Grabbable.ResetScale ( )

◆ setupConfigJointGrab()

virtual void BNG.Grabbable.setupConfigJointGrab ( Grabber  grabbedBy,
GrabType  grabType 
)
protectedvirtual

◆ setupFixedJointGrab()

virtual void BNG.Grabbable.setupFixedJointGrab ( Grabber  grabbedBy,
GrabType  grabType 
)
protectedvirtual

◆ setupKinematicGrab()

virtual void BNG.Grabbable.setupKinematicGrab ( Grabber  grabbedBy,
GrabType  grabType 
)
protectedvirtual

◆ setupVelocityGrab()

virtual void BNG.Grabbable.setupVelocityGrab ( Grabber  grabbedBy,
GrabType  grabType 
)
protectedvirtual

◆ SubscribeToMoveEvents()

virtual void BNG.Grabbable.SubscribeToMoveEvents ( )
virtual

Subscribe to any movement-related events that might cause our Grabbable to suddenly move far away. By subscribing to these events before they occur we can then respond better to these positional updates.

◆ UnlockGrabbable()

virtual void BNG.Grabbable.UnlockGrabbable ( )
virtual

Allow the Grabbable to move.

◆ UnsubscribeFromMoveEvents()

virtual void BNG.Grabbable.UnsubscribeFromMoveEvents ( )
virtual

◆ Update()

virtual void BNG.Grabbable.Update ( )
virtual

◆ UpdateFixedJoints()

virtual void BNG.Grabbable.UpdateFixedJoints ( )
virtual

◆ UpdateKinematicPhysics()

virtual void BNG.Grabbable.UpdateKinematicPhysics ( )
virtual

◆ UpdateOriginalParent() [1/2]

void BNG.Grabbable.UpdateOriginalParent ( )

◆ UpdateOriginalParent() [2/2]

void BNG.Grabbable.UpdateOriginalParent ( Transform  newOriginalParent)

◆ UpdatePhysicsJoints()

virtual void BNG.Grabbable.UpdatePhysicsJoints ( )
virtual

◆ UpdateRemoteGrab()

virtual void BNG.Grabbable.UpdateRemoteGrab ( )
virtual

◆ UpdateVelocityPhysics()

virtual void BNG.Grabbable.UpdateVelocityPhysics ( )
virtual

Member Data Documentation

◆ ActiveGrabPoint

GrabPoint BNG.Grabbable.ActiveGrabPoint

Returns the active GrabPoint component if object is held and a GrabPoint has been assigneed.

◆ AddControllerVelocityOnDrop

bool BNG.Grabbable.AddControllerVelocityOnDrop = true

Set to True to throw the Grabbable by applying the controller velocity to the grabbable on drop. Set False if you don't want the object to be throwable, or want to apply your own force manually.

◆ ApplyCorrectiveForce

bool BNG.Grabbable.ApplyCorrectiveForce = true

◆ BeingHeld

bool BNG.Grabbable.BeingHeld = false

Is this object currently being held by a Grabber.

◆ BreakDistance

float BNG.Grabbable.BreakDistance = 0

Drop the item if object's center travels this far from the Grabber's Center (in meters). Set to 0 to disable distance break.

◆ CanBeDropped

bool BNG.Grabbable.CanBeDropped = true

Set to false to disable dropping. If false, will be permanently attached to whatever grabs this.

◆ CanBeSnappedToSnapZone

bool BNG.Grabbable.CanBeSnappedToSnapZone = true

Can this object be snapped to snap zones? Set to false if you never want this to be snappable. Further filtering can be done on the SnapZones.

◆ col

Collider BNG.Grabbable.col
protected

◆ CollisionAngularMotionX

ConfigurableJointMotion BNG.Grabbable.CollisionAngularMotionX = ConfigurableJointMotion.Free

◆ CollisionAngularMotionY

ConfigurableJointMotion BNG.Grabbable.CollisionAngularMotionY = ConfigurableJointMotion.Free

◆ CollisionAngularMotionZ

ConfigurableJointMotion BNG.Grabbable.CollisionAngularMotionZ = ConfigurableJointMotion.Free

◆ CollisionLinearMotionX

ConfigurableJointMotion BNG.Grabbable.CollisionLinearMotionX = ConfigurableJointMotion.Free

◆ CollisionLinearMotionY

ConfigurableJointMotion BNG.Grabbable.CollisionLinearMotionY = ConfigurableJointMotion.Free

◆ CollisionLinearMotionZ

ConfigurableJointMotion BNG.Grabbable.CollisionLinearMotionZ = ConfigurableJointMotion.Free

◆ collisions

List<Collider> BNG.Grabbable.collisions

◆ CollisionSlerp

float BNG.Grabbable.CollisionSlerp = 500

How much Slerp Force to apply to the joint when something is in contact with the grabbable.

◆ CollisionSpring

float BNG.Grabbable.CollisionSpring = 3000

How much Spring Force to apply to the joint when something comes in contact with the grabbable A higher Spring Force will make the Grabbable more rigid.

◆ connectedJoint

ConfigurableJoint BNG.Grabbable.connectedJoint
protected

◆ CustomHandPose

HandPoseId BNG.Grabbable.CustomHandPose = HandPoseId.Default

Animator ID of the Hand Pose to use.

◆ didParentHands

bool BNG.Grabbable.didParentHands = false
protected

◆ events

List<GrabbableEvents> BNG.Grabbable.events
protected

◆ FlickForce

float BNG.Grabbable.FlickForce = 1f

◆ flyingTo

Grabber BNG.Grabbable.flyingTo
protected

◆ ForceDisableKinematicOnDrop

bool BNG.Grabbable.ForceDisableKinematicOnDrop = false

◆ GrabButton

GrabButton BNG.Grabbable.GrabButton = GrabButton.Inherit

Configure which button is used to initiate the grab.

◆ GrabMechanic

GrabType BNG.Grabbable.GrabMechanic = GrabType.Precise

Snap to a location or grab anywhere on the object.

◆ GrabPhysics

GrabPhysics BNG.Grabbable.GrabPhysics = GrabPhysics.Velocity

Kinematic Physics locks the object in place on the hand / grabber. PhysicsJoint allows collisions with the environment.

◆ GrabPoints

List<Transform> BNG.Grabbable.GrabPoints

If Grab Mechanic is set to Snap, the closest GrabPoint will be used. Add a SnapPoint Component to a GrabPoint to specify custom hand poses and rotation.

◆ GrabSpeed

float BNG.Grabbable.GrabSpeed = 15f

How fast to Lerp the object to the hand.

◆ Grabtype

HoldType BNG.Grabbable.Grabtype = HoldType.Inherit

'Inherit' will inherit this setting from the Grabber. 'Hold' requires the user to hold the GrabButton down. 'Toggle' will drop / release the Grabbable on button activation.

◆ handPoseType

HandPoseType BNG.Grabbable.handPoseType = HandPoseType.HandPose

◆ heldByGrabbers

List<Grabber> BNG.Grabbable.heldByGrabbers
protected

The grabber that is currently holding us. Null if not being held.


◆ HideHandGraphics

bool BNG.Grabbable.HideHandGraphics = false

Enabling this will hide the Transform specified in the Grabber's HandGraphics property.

◆ initialCollisionMode

CollisionDetectionMode BNG.Grabbable.initialCollisionMode
protected

◆ initialHandPose

HandPose BNG.Grabbable.initialHandPose
protected

◆ initialHandPoseId

HandPoseId BNG.Grabbable.initialHandPoseId
protected

◆ initialHandPoseType

HandPoseType BNG.Grabbable.initialHandPoseType
protected

◆ initialInterpolationMode

RigidbodyInterpolation BNG.Grabbable.initialInterpolationMode
protected

◆ input

InputBridge BNG.Grabbable.input
protected

◆ InstantMovement

bool BNG.Grabbable.InstantMovement = false

◆ LastDropTime

float BNG.Grabbable.LastDropTime

Time in seconds (Time.time) when we last dropped this item.

◆ lastFlickTime

float BNG.Grabbable.lastFlickTime

◆ LastGrabTime

float BNG.Grabbable.LastGrabTime

Time in seconds (Time.time) when we last grabbed this item.

◆ lastItemTeleportTime

float BNG.Grabbable.lastItemTeleportTime
protected

◆ LocalOffsetTransform

Transform BNG.Grabbable.LocalOffsetTransform

◆ MakeChildCollidersGrabbable

bool BNG.Grabbable.MakeChildCollidersGrabbable = false

◆ MoveAngularVelocityForce

float BNG.Grabbable.MoveAngularVelocityForce = 90f

◆ MoveVelocityForce

float BNG.Grabbable.MoveVelocityForce = 3000f

◆ originalParent

Transform BNG.Grabbable.originalParent
protected

◆ OtherGrabbableMustBeGrabbed

Grabbable BNG.Grabbable.OtherGrabbableMustBeGrabbed = null

The Grabbable can only be grabbed if this grabbable is being held. Example : If you only want a weapon part to be grabbable if the weapon itself is being held.

◆ ParentHandModel

bool BNG.Grabbable.ParentHandModel = true

If true, the hand model will be attached to the grabbed object.

◆ ParentToHands

bool BNG.Grabbable.ParentToHands = false

Parent this object to the hands for better stability. Not recommended for child grabbers.

◆ previousPosition

Vector3 BNG.Grabbable.previousPosition
protected

◆ primaryGrabOffset

Transform BNG.Grabbable.primaryGrabOffset
protected

If Grab Mechanic is set to Snap, set position and rotation to this Transform on the primary Grabber.

◆ recentlyTeleported

bool BNG.Grabbable.recentlyTeleported
protected

◆ RemoteGrabbable

bool BNG.Grabbable.RemoteGrabbable = false

Can the object be picked up from far away. Must be within RemoteGrabber Trigger.

◆ remoteGrabbing

bool BNG.Grabbable.remoteGrabbing
protected

◆ RemoteGrabDistance

float BNG.Grabbable.RemoteGrabDistance = 2f

Max Distance Object can be Remote Grabbed. Not applicable if RemoteGrabbable is false.

◆ RemoteGrabMechanic

RemoteGrabMovement BNG.Grabbable.RemoteGrabMechanic = RemoteGrabMovement.Linear

◆ rigid

Rigidbody BNG.Grabbable.rigid
protected

◆ SecondaryGrabbable

Grabbable BNG.Grabbable.SecondaryGrabbable

◆ SecondaryGrabBehavior

OtherGrabBehavior BNG.Grabbable.SecondaryGrabBehavior = OtherGrabBehavior.None

What to do if another grabber grabs this while equipped. DualGrab is currently unsupported.

◆ secondaryGrabOffset

Transform BNG.Grabbable.secondaryGrabOffset
protected

◆ SecondaryLookAtTransform

Transform BNG.Grabbable.SecondaryLookAtTransform

◆ SecondaryLookOffset

Vector3 BNG.Grabbable.SecondaryLookOffset

◆ SecondHandLookSpeed

float BNG.Grabbable.SecondHandLookSpeed = 40f

◆ SelectedHandPose

HandPose BNG.Grabbable.SelectedHandPose

◆ SnapHandModel

bool BNG.Grabbable.SnapHandModel = true

◆ ThrowForceMultiplier

float BNG.Grabbable.ThrowForceMultiplier = 2f

Multiply controller's velocity times this when throwing.

◆ ThrowForceMultiplierAngular

float BNG.Grabbable.ThrowForceMultiplierAngular = 1.5f

Multiply controller's angular velocity times this when throwing.

◆ TwoHandedDropBehavior

TwoHandedDropMechanic BNG.Grabbable.TwoHandedDropBehavior = TwoHandedDropMechanic.Drop

◆ TwoHandedLookVector

TwoHandedLookDirection BNG.Grabbable.TwoHandedLookVector = TwoHandedLookDirection.Horizontal

◆ TwoHandedPosition

TwoHandedPositionType BNG.Grabbable.TwoHandedPosition = TwoHandedPositionType.Lerp

◆ TwoHandedPostionLerpAmount

float BNG.Grabbable.TwoHandedPostionLerpAmount = 0.5f

◆ TwoHandedRotation

TwoHandedRotationType BNG.Grabbable.TwoHandedRotation = TwoHandedRotationType.Slerp

◆ TwoHandedRotationLerpAmount

float BNG.Grabbable.TwoHandedRotationLerpAmount = 0.5f

◆ UseCustomInspector

bool BNG.Grabbable.UseCustomInspector = true

Set this to false if you need to see Debug field or don't want to use the custom inspector.

◆ usedGravity

bool BNG.Grabbable.usedGravity
protected

◆ wasKinematic

bool BNG.Grabbable.wasKinematic
protected

Save whether or not the RigidBody was kinematic on Start.

Property Documentation

◆ BeingHeldWithTwoHands

bool BNG.Grabbable.BeingHeldWithTwoHands
get

Is this object currently being held by more than one Grabber.

◆ CanBeMoved

bool BNG.Grabbable.CanBeMoved
get

Can the object be moved towards a Grabber. Levers, buttons, doorknobs, and other types of objects cannot be moved because they are attached to another object or are static.

◆ DidParentHands

bool BNG.Grabbable.DidParentHands
get

◆ FlyingToGrabber

Grabber BNG.Grabbable.FlyingToGrabber
get

◆ GrabPositionOffset

Vector3 BNG.Grabbable.GrabPositionOffset
get

◆ GrabRotationOffset

Vector3 BNG.Grabbable.GrabRotationOffset
get

◆ grabTransform

Transform BNG.Grabbable.grabTransform
get

◆ grabTransformSecondary

Transform BNG.Grabbable.grabTransformSecondary
get

◆ HeldByGrabbers

List<Grabber> BNG.Grabbable.HeldByGrabbers
get

◆ lastCollisionSeconds

float BNG.Grabbable.lastCollisionSeconds
getprotected set

◆ lastNoCollisionSeconds

float BNG.Grabbable.lastNoCollisionSeconds
getprotected set

How many seconds we've gone without collisions.

◆ OriginalScale

Vector3 BNG.Grabbable.OriginalScale
get

◆ player

BNGPlayerController BNG.Grabbable.player
getprotected

If a BNGPlayerController is provided we can check for player movements and make certain adjustments to physics.

◆ RecentlyCollided

bool BNG.Grabbable.RecentlyCollided
get

Have we recently collided with an object.

◆ RemoteGrabbing

bool BNG.Grabbable.RemoteGrabbing
get

Is the object being pulled towards the Grabber.

◆ requestSpringTime

float BNG.Grabbable.requestSpringTime
getprotected set

The documentation for this class was generated from the following file: