# Events

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

Declare a method with one of these names in any script on the body node or on the collider node:

    func OnCollisionEnter(other NodeRef, c physics.Contact)
    func OnCollisionStay(other NodeRef, c physics.Contact)
    func OnCollisionExit(other NodeRef, c physics.Contact)
    func OnTriggerEnter(other NodeRef)
    func OnTriggerExit(other NodeRef)

Both participants get the event, each from its own side. `other` is the other body's node; `c.Normal` points from the other body into the receiver, so a floor under you reports `c.Normal.Y < 0`. `c.SelfCollider` and `c.OtherCollider` name the collider nodes. Events run after the physics step, before `script.events_fixed` ends the fixed tick.

`OnCollisionStay` runs every step while two bodies touch, and only when some script handles it; prefer Enter/Exit counters. Exit also comes when a body is destroyed or disabled; `other.IsAlive()` is then false.

Destroying nodes inside a handler is safe: the removal happens after all handlers ran.
