DropTarget
Marks a node as somewhere a drag can land: a hotbar slot, a rune socket. Accepts lists the kinds it takes, empty meaning any, Disabled makes it take none, and a refused drop is reported so the item can be put back. Goes under a Canvas.
On this page
Add it
Add component → DropTargetComponent in the Inspector, on the node that should carry it.
From a script
A script on the same node writes these fields by name. DropTargetComponent is the name to pass.
rgs
set_text("DropTargetComponent", "action", "");
set_flag("DropTargetComponent", "disabled", false); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Action | action | text | empty | Reported when a drag lands here, with the number it carried; a slot that is also a drag source needs a different action on each end, since one action cannot tell an item arriving here from this slot's own item landing. |
| Accepts | accepts | list | empty | Payload kinds this accepts; empty accepts anything. |
| Disabled | disabled | checkbox | off | When on, this takes no drop, and a drag let go over it comes back. |
Buttons
- Trim Kinds Strip stray whitespace from the accepted kinds and drop the blank ones