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
| Field | Type | Unit / range | What it does |
|---|---|---|---|
kind | text | — | "door", "pickup", "switch" or "vehicle". |
prompt | text | — | The word on the prompt ("open the hatch"); empty: the action's name. |
range | number | m, 0.2 … 20 | How close an actor must be to use it (from its middle). |
hold | number | s, 0 … 30 | Seconds the use key must be held; letting go early cancels. 0: a press. |
locked | true / false | — | Starts locked: unlocking needs the key item. |
key | text | — | The inventory item that locks and unlocks it ("red_key"). |
consumes_key | true / false | — | Unlocking uses the key up. |
open | true / false | — | Doors: starts open. Switches: starts on. |
hinge | (x, y, z) | m | Doors: 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. |
swing | number | deg, -180 … 180 | Doors: how far it swings open; the sign picks the way. |
speed | number | deg/s, 1 … 2000 | Doors: swing speed. |
one_way | true / 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) | m | Doors: where an actor takes hold (a handle), in its own frame; reach is measured to it. Unset: the middle of its box. |
item | text | — | Pickups: the inventory item it gives ("red_key", "fuse"). |
count | number | 0 … 100000 | Pickups: how many. |
message | text | — | Switches: the message every scripted object gets when it's used ("power_on"). |
power | text | — | 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