Draggable

Dragging gameobject.

Options

  • Interactable bool

    Allow interaction.

  • Handle GameObject optional

    GameObject used to drag current GameObject.

  • Horizontal bool

    Allow horizontal drag movement.

  • Vertical bool

    Allow vertical drag movement.

  • Restriction DraggableRestriction:

    • None: no restriction.

    • Strict: does not allow drag outside the parent.

    • After Drag: does not allow drag outside the parent, applied after drag ended.

  • Curve AnimationCurve

    Animation curve used to animate applied After Drag restriction.

  • UnscaledTime bool

    Run animation with unscaled time.

Properties

  • Target RectTransform

    Target to drag; the self is by default.

Events

  • OnStartDrag UnityEvent<Draggable>

  • OnDrag UnityEvent<Draggable>

  • OnEndDrag UnityEvent<Draggable>