Skip to reading
GDScript Programming & Godot

Gameplay: Continuous object effects and attachments

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

Configure an effect or attach point first, then use these actions to control it. An attach point is a named location on an object, model bone or sprite. Contact watches report proximity between points; they are not a full physics collision system.

ToggleMotion()#

Toggle Motion

Invert an object's authored motion-enabled state, optionally mirroring that state into a variable.

Source table from Gameplay: Continuous object effects and attachments, page 161
Option key / fieldMeaning and inputDefault
Room sceneIdChoose a scene ID.Blank
Object entityIdChoose an entity in the selected scene.Blank
State Variable (optional) variableChoose a game variable name. May be blank.Blank

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

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

In use. Toggle a rotating sign when a switch is used. Configure the object's motion in its inspector first. Repeated events invert the state again; use Set Motion when a specific final state matters.

Page 161 of 378Permalink
Go to page