Skip to content

GameObject Undock From Interactable

Undocks a GameObject from an Interactable using its undocking transform when assigned, otherwise the Interactable transform.

Parameter Description
GameObject The GameObject to undock.
Interactable The Interactable to undock from.
Set Position Match the undocking position.
Set Rotation Match the undocking rotation.
Zero Velocity Zero Rigidbody or Rigidbody2D velocity after undocking.
Smooth Duration Smooth undocking duration in seconds. Set to 0 for an immediate snap.
Easing Easing function used for smooth undocking transitions.
Undocking Transform Output undocking transform used.
Undocked Event Optional event sent after undocking completes.

Notes

  • Uses Rigidbody or Rigidbody2D APIs when present, otherwise sets the transform directly.
  • Falls back to the Interactable transform if no undocking transform is assigned.

Example

Use this when leaving a seat, ladder, vehicle, or other docked interaction and you want a controlled exit position.

See also