Skip to reading
Action Lists & Events

OnTriggerEntered

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView PDF page
On this page

GDScript handler: on_trigger_entered(event: Dictionary = {})

The active player enters an eligible trigger/interactive-region overlap.

Source table from OnTriggerEntered, page 48
Standard contextPractical use / limits
triggerId, entityId, sceneId, playerId, event="enter"; regionId for a regionIn the checked 3D route, other NPC bodies do not trigger this player-entry hook. The shared event runs before local onEnter actions. Starting inside a volume can create startup contact behavior; test that case separately.

OnTriggerExited#

GDScript handler: on_trigger_exited(event: Dictionary = {})

The active player leaves an eligible trigger/interactive-region overlap.

Source table from OnTriggerEntered, page 48
Standard contextPractical use / limits
triggerId, entityId, sceneId, playerId, event="exit"; regionId for a regionUse it for leaving a local effect area. Teleports and room changes are not guaranteed to behave like ordinary walking out of the same live volume; perform important cleanup in the owning scene/sequence too.

OnAttachPointContact#

Code example
GDScript handler: on_attach_point_contact(event: Dictionary = {})

A named attach-point watch reports entering or leaving point contact.

Source table from OnTriggerEntered, page 48
Standard contextPractical use / limits
watchId, phase, entityId, point, targetId, targetPoint, sceneId, touching, swept, position, distance, fraction, contactRadius, dimensionFilter watchId and phase="enter" for a one-shot success. A swept contact may report enter and exit between samples. Stop the watch when its job ends and set a completion flag before awarding the result.
Page 48 of 189Permalink
Go to page