Skip to content

Components

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

FieldScript nameKindDefaultWhat it does
ActionactiontextemptyReported 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.
AcceptsacceptslistemptyPayload kinds this accepts; empty accepts anything.
DisableddisabledcheckboxoffWhen 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