action_2d
2D: how an object takes part in action. One accepted hit (its anim_2d hit boxes touching another's hurt box, a stomp, or a script's self.hit) applies damage once and drives everything else: hit-stop on both sides, camera shake, the target's flash, knockback, a burst and a sound. Scripts get onMessage 'hurt' { damage, by, health, seq } and 'hit_landed' { target, seq }.
In scene text
action_2d { team "…" health 1 damage 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 14
| Field | Type | Unit / range | What it does |
|---|---|---|---|
team | text | — | Hits never land on the same team ("player", "enemy"; empty: anyone but itself). |
health | number | 0 … 1e+06 | Health (0: not tracked here; scripts keep their own). At 0 it gets onMessage 'defeated'. |
damage | number | 0 … 1e+06 | Damage its hits deal. |
invulnerable | number | s, 0 … 10 | Seconds it can't be hit again after a hit lands on it. |
hit_stop | number | s, 0 … 0.5 | Both sides pause on contact: light 0.033, medium 0.05, heavy 0.083. |
world_stop | number | s, 0 … 0.5 | The whole world pauses on contact (exceptional impacts only). |
shake | number | px, 0 … 32 | Camera shake on contact in screen pixels (of a 720-line screen; virtual pixels in pixel art): 1 to 4. |
shake_time | number | s, 0 … 2 | How long the shake lasts (0.08 to 0.18). |
flash | number | s, 0 … 1 | Seconds the target's silhouette flashes (0.05 to 0.1). |
flash_color | colour (r, g, b) | — | The flash's colour. |
knockback | (x, y, z) | units/s | A hit's push on the target: (away from the attacker, up, 0). |
burst | text | — | The burst at the contact: "spark", "dust", "slash", "poof", an image in Assets, or "" none. |
sound | text | — | The sound of a hit landing ("" none). |
squash | number | 0 … 0.5 | Squash and stretch on landing and take-off, drawing only (its box never changes), with a dust puff on landing: 0 none, 0.15 lively. |
Arcwright Beta 2 (0.4.0) · generated from the engine source (25e375c86)Something wrong or missing? Tell us