![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
Put this script on objects you want to damage entities upon colliding with them. Useful for stage hazards, such as the Falling Spike.prefab.
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. | |
bool | destroyOnCollision = true |
If true, the object will be destroyed as soon as it collides with something (regardless of if it's damagable or not). | |
Private Member Functions | |
void | OnCollisionEnter2D (Collision2D 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 DamageOnCollision.colisionDamage = 40 |
Amount of damage to apply when upon colliding with an object (that can be damaged).
bool DamageOnCollision.damageNonPlayers = true |
If true, entities that are not the player will take damage when colliding with this object.
bool DamageOnCollision.damagePlayer = true |
If true, the player will take damage when colliding with this object.
bool DamageOnCollision.destroyOnCollision = true |
If true, the object will be destroyed as soon as it collides with something (regardless of if it's damagable or not).