Collision Detection and Events
The Character
class includes numerous events that allow you to manage different character interactions. For instance, there is OnCollided
, which is triggered when the character makes contact with a collider while executing a Move
, OnFoundGround
, which is triggered when a character detects any ground surface (whether walkable or not-walkable), among others.
When extending a Character
class, it is advisable to override its corresponding event trigger method. For example, override the OnCollided
method to handle a collision:
On the other hand, when extending a Character
through composition, it's advisable to listen to its exposed events. For example, subscribe to its Collided
event to handle a collision:
The procedure is the same for its other events.
Last updated