![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
Put this script on objects you want to damage entities upon touching with them. The difference between this and DamageOnCollision is this is for objects whose Collider2D has isTrigger checked off in the editor. Useful for stage hazards, such as the spikes tile.
Documentation updated 8/26/2024
Public Attributes | |
int | colisionDamage = 40 |
Amount of damage to apply when upon colliding with an object (that can be damaged). | |
bool | damageNonPlayers = true |
If true, entities that are not the player will take damage when colliding with this object. | |
bool | damagePlayer = true |
If true, the player will take damage when colliding with this object. | |
Private Member Functions | |
void | OnTriggerEnter2D (Collider2D col) |
When an object collides with this object, damage it if it has an object health (unless damageNonPlayers or damagePlayer dictates otherwise). Then destroy the game object (if destroyOnCollision is true). | |
|
private |
When an object collides with this object, damage it if it has an object health (unless damageNonPlayers or damagePlayer dictates otherwise). Then destroy the game object (if destroyOnCollision is true).
col | Represents the object that collided with this object. |
int DamageOnTrigger.colisionDamage = 40 |
Amount of damage to apply when upon colliding with an object (that can be damaged).
bool DamageOnTrigger.damageNonPlayers = true |
If true, entities that are not the player will take damage when colliding with this object.
bool DamageOnTrigger.damagePlayer = true |
If true, the player will take damage when colliding with this object.