Skip to reading
GDScript Programming & Godot

SetTriggerEnabled()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Enable / Disable Trigger

Enable or disable a trigger's runtime event behavior.

Source table from SetTriggerEnabled(), page 128
Option key / fieldMeaning and inputDefault
Room sceneIdChoose a scene ID.Blank
Trigger entityIdChoose a trigger in the selected scene.Blank
Enabled enabledExplicit on/off state for the feature or response.true

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await SetTriggerEnabled({"sceneId": "lab", "entityId": "archive_door", "enabled": true})

In use. Turn off a doorway trigger during an opening cutscene, then turn it on when play begins. Existing overlaps and the player starting inside the volume need to be tested; do not treat the toggle as a guaranteed fresh Enter event.

SpawnObject()#

Spawn Scene Object

Spawn or restore an already authored scene object definition.

Source table from SetTriggerEnabled(), page 128
Option key / fieldMeaning and inputDefault
Room sceneIdChoose a scene ID.Blank
Scene Object entityIdChoose an entity in the selected scene.Blank

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await SpawnObject({"sceneId": "lab", "entityId": "archive_door"})

In use. Restore a temporary prop that was despawned. The chosen object must have an authored definition the runtime can find. Use Create Primitive or Add Asset To Scene to create a new record instead.

Page 128 of 378Permalink
Go to page