interactable

Something players, bots, creatures and scripts act on through actions: a hinged door (open, close, lock, unlock; blocked by what's in its way), a pickup (pick_up into the inventory), a switch (use: a message, the power) or a vehicle seat (enter, exit). Players get a prompt ("E: open"); scripts call self.act("open") or game.act(entity, "open"); bots use doors and keys to reach objectives.

In scene text

interactable { kind "…"  prompt "…"  range 1 }

Add it in the Inspector (Add Component), in scene text as above, or ask your AI. Fields you leave out keep their defaults.

Fields 18

FieldTypeUnit / rangeWhat it does
kindtext—"door", "pickup", "switch" or "vehicle".
prompttext—The word on the prompt ("open the hatch"); empty: the action's name.
rangenumberm, 0.2 … 20How close an actor must be to use it (from its middle).
holdnumbers, 0 … 30Seconds the use key must be held; letting go early cancels. 0: a press.
lockedtrue / false—Starts locked: unlocking needs the key item.
keytext—The inventory item that locks and unlocks it ("red_key").
consumes_keytrue / false—Unlocking uses the key up.
opentrue / false—Doors: starts open. Switches: starts on.
hinge(x, y, z)mDoors: the hinge point from the pivot, in the object's frame (x right, y up, -z ahead), e.g. (-0.65, 0, 0) for a 1.3 m door's left edge.
swingnumberdeg, -180 … 180Doors: how far it swings open; the sign picks the way.
speednumberdeg/s, 1 … 2000Doors: swing speed.
one_waytrue / false—Doors: always swing the way swing says (a car door); off: away from whoever opens it.
axis(x, y, z)—Doors: the axis it swings about, in its own frame: (0, 1, 0) a door, (1, 0, 0) a hood or trunk lid.
grab(x, y, z)mDoors: where an actor takes hold (a handle), in its own frame; reach is measured to it. Unset: the middle of its box.
itemtext—Pickups: the inventory item it gives ("red_key", "fuse").
countnumber0 … 100000Pickups: how many.
messagetext—Switches: the message every scripted object gets when it's used ("power_on").
powertext—Switches: "on", "off" or "toggle" the power (blackout) when used; empty leaves it.
Arcwright Beta 2 (0.4.0) · generated from the engine source (25e375c86)Something wrong or missing? Tell us
Download Arcwright free