Skip to reading
GDScript Programming & Godot

Gameplay: Objects, descriptions and scene life

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

Visible, enabled, interactive and physically blocking are separate ideas. Use the smallest change that matches the story. For an item pickup, hiding its world representation and giving its inventory definition are two distinct actions.

SetObjectActionEnabled()#

Enable / Disable Object Action

Enable or disable one object's interaction event or verb response.

Source table from Gameplay: Objects, descriptions and scene life, page 126
Option key / fieldMeaning and inputDefault
Room sceneIdChoose a scene ID.Blank
Object entityIdChoose an entity in the selected scene.Blank
Mouse / Trigger Action actionEventChoose the response/event to enable or disable.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 SetObjectActionEnabled({
    "sceneId": "lab",
    "entityId": "archive_door",
    "actionEvent": ""
})

In use. Disable Use after a machine has been repaired while keeping Look available. Choose the intended event. This is more precise than disabling the entire object.

Page 126 of 378Permalink
Go to page