Addon ID

  • salmanshh_dragndrop

Info

Statistics

  • Download count4 total downloads
  • Latest download count 4 downloads of latest version
  • Average download count7 downloads per day average

Owners

A list of all Actions, Conditions and Expressions supported in this addon.

Dragging & Throw

  • Actions

    {my}: Drop ({0})

    Ends the current drag. Release applies the measured throw; Cancel ends silently. Ignored if not dragging.

    {my}: Set drag point to ({0}, {1})

    Updates the world-space point the object follows. Call every tick while dragging.

    {my}: Set drag point to {0}

    Updates the world-space point the object follows to another object's position. Call every tick while dragging.

    {my}: Set enabled {0}

    Enables or disables the behaviour. Disabling cancels any in-progress drag.

    {my}: Set throw velocity to ({0}, {1})

    Overrides the measured throw before a release. Pass 0, 0 to suppress the throw entirely.

    {my}: Start drag at ({0}, {1}) using {2}

    Begins dragging this object toward a drag point. Ignored if already dragging.

    {my}: Start drag at {0} using {1}

    Begins dragging this object at the target's position and keeps the drag point glued to that object each tick, so it sticks to a moving target. Ignored if already dragging.

  • Conditions

    {my}: Is dragging

    True while the object is being dragged.

    {my}: Is enabled

    True if the behaviour is active.

    {my}: On drag cancelled

    Triggered when a drag ends via Drop (cancel) or a break-distance cancel. No throw is applied.

    {my}: On drag started

    Triggered when Start Drag succeeds.

    {my}: On dropped

    Triggered when a drag ends via Drop (release) or a break-distance drop. The throw is available.

  • Expressions

    DragPointObjectUID

    UID of the object the drag point is glued to (set by Start drag at object), or -1 if the drag point is a free position.

    DragPointX

    Current world-space X of the drag point.

    DragPointY

    Current world-space Y of the drag point.

    DropReason

    Why the drag ended: "manual" for a Drop action, "broke_distance" for a break-distance end.

    ThrowSpeed

    Magnitude of the throw velocity. Use inside On Dropped.

    ThrowVelocityX

    X component of the measured throw velocity. Use inside On Dropped.

    ThrowVelocityY

    Y component of the measured throw velocity. Use inside On Dropped.

Movement & Collision

  • Actions

    {my}: Set break distance to {0} ({1})

    If the gap to the drag point grows past the distance, the drag ends automatically. 0 disables this.

    {my}: Set directions to {0}

    Constrains drag movement, 8Direction style: free, a single axis, or snapped to 4 / 8 directions.

    {my}: Set follow mode to {0}

    Switches how the object moves toward the drag point: Instant (snap each tick), Constant Speed (uses Follow Speed), Spring Physics (uses Spring Stiffness and Damping), or Grid (snaps to a tile grid set by the Set grid action).

    {my}: Set follow speed to {0}

    How fast the object catches up to the drag point, in pixels per second. 0 = instant snap.

    {my}: Set grid to {0} x {1} (origin {2}, {3})

    Sets the tile grid used by the Grid follow mode: cell width and height plus an origin offset. While Follow Mode is Grid, the object snaps to the nearest cell. A width or height of 0 leaves that axis unsnapped.

    {my}: Set spring stiffness {0} damping {1}

    Sets the spring-physics parameters. Stiffness controls pull strength (pixels/s^2 per pixel of displacement); damping controls oscillation bleed-off (1/s). Does not switch the follow mode — use Set follow mode to Spring Physics first.

  • Expressions

    DistanceFromPoint

    Current gap in pixels between the object and the drag point. Grows while blocked by a solid.

    SpringVelocityX

    X component of the object's current spring velocity in pixels per second. Valid while Follow Mode is Spring Physics.

    SpringVelocityY

    Y component of the object's current spring velocity in pixels per second. Valid while Follow Mode is Spring Physics.

Snapping & Magnet

  • Actions

    {my}: Add snap object {0}

    Registers an object as a snap and magnet target by its position. Use a For each loop to add many. Needs a snap radius to take effect.

    {my}: Add snap position ({0}, {1})

    Registers a world-space position as a snap and magnet target. Needs a snap radius to take effect.

    {my}: Clear snap targets

    Removes all registered snap positions and snap objects.

    {my}: Set magnet strength to {0}

    How strongly the object is pulled toward an in-range snap target while dragging, from 0 (snap only on drop) to 1 (strong homing).

    {my}: Set snap mode to {0}

    How snapping detects a target: Radius (object within snap radius) or Overlap (the drag position collides with a target object, or the dragged object overlaps it).

    {my}: Set snap radius to {0}

    Distance in pixels within which the object snaps to a target on drop and is magnetised while dragging. 0 disables snapping.

  • Conditions

    {my}: Is snapping

    True while the dragged object is within snap radius of a target (so a drop would snap to it).

    {my}: On snapped

    Triggered after a release that lands within snap radius of a target. Fires alongside On Dropped. Read SnapTargetX, SnapTargetY, and SnappedObjectUID.

  • Expressions

    SnappedObjectUID

    UID of the object snapped to on the last drop, or -1 if the snap was a position or no snap occurred.

    SnapTargetX

    X of the nearest snap target. While dragging it tracks the nearest target; after a snap it is the snapped position.

    SnapTargetY

    Y of the nearest snap target. While dragging it tracks the nearest target; after a snap it is the snapped position.