DamageOnTouch
Hurts whatever with Health it touches, with no code: spikes, lava, enemies, bullets. Works on solid collisions and triggers, and keeps hurting while they stay touching (each hit still waits out the target’s Health.InvincibleTime). Needs a collider on the same entity.
Requires: Collider
Properties
Section titled “Properties”Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.
amount: a number = 1. How much health each hit takes. (Field: a number.)amountRoll: text = null. Dice rolled for each hit in place of Amount, e.g. “1d8+2”; empty hits for Amount every time. Table Values sets it from a dice column given for Amount. (Dice: how many, “d”, their sides, then anything added or taken away, e.g. “2d6+3”, “d20”, “1d8+1d6-1” or a plain number; empty for none. The Inspector builds them and shows the lowest, highest and average roll.) (Field: its own editor: Dice.)layers: text = null. The collision layers it hurts, e.g. “Player” on spikes and enemies, “Enemy” on the player’s bullets. Empty hurts anything with health. (Names collision layers: their names, separated by commas.) (Field: a name.)knockback: a number = 0. How hard a hit pushes the target’s body away, in units per second. 0 doesn’t push. (Field: a number.)destroyOnHit: true or false = false. Destroy this entity when it touches something it can hurt, like a bullet or a one-hit kamikaze enemy. (Field: on or off.)kill: true or false = false. Kill outright, invincible or not, whatever the Amount: bottomless pits, lava, crushers. (Field: on or off.)destroyOnWall: true or false = false. Destroy this entity when it runs into a wall or anything else solid it can’t hurt: bullets, fireballs, arrows. (Field: on or off.)
Scripts use it as DamageOnTouch: its methods, events and values that aren’t saved with the scene.