> For the complete documentation index, see [llms.txt](https://help.craftsmanplus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.craftsmanplus.com/play/properties/interactions/gestures/drag-and-drop.md).

# Drag and Drop

Let the user drag a layer onto a target layer, with animations and an action for a successful drop.

<figure><img src="https://3019081569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZBycFFNxrdS0X9OsGtmT%2Fuploads%2Fgit-blob-536588ee2fcb87c0d8cf33480368de2868fb9bed%2Fgestures-drag-and-drop.png?alt=media" alt="The Interaction Properties popup with the Drag and Drop gesture selected"><figcaption></figcaption></figure>

The **Drag and Drop** gesture lets the user drag a layer onto a target. A drop on the target is a **right drop** and runs an action. A drop anywhere else is a **wrong drop**.

This is useful for patterns like:

* Matching games, like dragging an item to the right bin
* Assembling an object from parts
* "Drag the product into the cart" CTAs

For free movement with no target, use [Drag](https://help.craftsmanplus.com/play/properties/interactions/gestures/drag.md) instead.

### How it Works

Drag and Drop has the following settings, in order:

* **Drop Target** selects the layer the user should drop onto. The list shows every layer in the scene except the dragged layer itself and layers hidden in the Layers Panel.
* **Right Drop Behavior** controls what happens to the layer after a right drop:
  * **Do Nothing** (default) leaves it where it was dropped.
  * **Move to Center** slides it onto the center of the target.
* **Dragging Animation** plays while the layer is being dragged:
  * **Do Nothing** (default)
  * **Rotate** spins the layer continuously, and restores its angle on release.
* **Right Drop Animation** plays after a right drop.
* **Wrong Drop Animation** plays after a wrong drop.
* **Snap Back** returns the layer to its original position after a wrong drop. Off by default.
* **Action** runs after a right drop. It stays disabled until a Drop Target is chosen.

Both drop animations offer the same list as [Drag](https://help.craftsmanplus.com/play/properties/interactions/gestures/drag.md): Blink, Bounce, Bubble, Pulse, Rotate, Slide, Shake or Squish.

#### Right and Wrong Drops

The drop is checked when the user lets go. It is a right drop when **any part of the dragged layer's bounding box overlaps the target's bounding box.** Where the finger is does not matter.

* **On a right drop,** the Right Drop Behavior runs, then the Right Drop Animation plays and the Action fires. **The layer locks in place** the moment it is dropped, so it cannot be dragged again, even while it moves to the center, until the scene restarts.
* **On a wrong drop,** the Action does not fire. With Snap Back on, the layer returns to where it started, then the Wrong Drop Animation plays. Grabbing it while it returns stops it where it is and skips the animation; the next wrong drop still returns it to where it first started. With Snap Back off, the layer stays where it was dropped and the animation plays right away.

{% hint style="info" %}
Bounding boxes are rectangles. An image with transparent edges counts as overlapping as soon as its rectangle touches the target, even if the visible pixels do not. Use a [Hotspot](https://help.craftsmanplus.com/play/layers/hotspots.md) sized to the real drop zone as the target for tighter control.
{% endhint %}

#### Multiple Targets

Add one Drag and Drop interaction per target to accept drops on several layers. Every target the layer overlaps on release counts as a right drop and runs its Action. Only one set of animations plays.

### Where You Can Use It

Drag and Drop is available on Images, Text, Shapes, Videos, Sequences and Groups. It is not available on:

* [Hotspots](https://help.craftsmanplus.com/play/layers/hotspots.md)
* Layers inside components
* [Global layers](https://help.craftsmanplus.com/play/layers/global-layers.md), or layers with their interactions synced

### Setting Up Drag and Drop

{% stepper %}
{% step %}

### Select the layer users will drag, and click **+** in the Interactions section.

{% endstep %}

{% step %}

### Set the **Gesture** to **Drag and Drop.**

{% endstep %}

{% step %}

### Choose a **Drop Target.**

{% endstep %}

{% step %}

### Set the drop behavior, animations and Snap Back.

{% endstep %}

{% step %}

### Choose the **Action** that runs after a right drop.

{% endstep %}

{% step %}

### Preview and drop the layer on and off the target to test both outcomes.

{% endstep %}
{% endstepper %}

{% hint style="warning" %}
If you hide the Drop Target in the Layers Panel, the **Drop Target** field shows empty. Show the layer again, or pick a new target.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.craftsmanplus.com/play/properties/interactions/gestures/drag-and-drop.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
