Skip to reading
GDScript Programming & Godot

SetPlayerInputEnabled()

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 Player Input

Enable or disable player control input.

Source table from SetPlayerInputEnabled(), page 120
Option key / fieldMeaning and inputDefault
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 SetPlayerInputEnabled({"enabled": true})

In use. Disable control during a carefully staged action and restore it on every exit path. Other locks, such as a running dialogue or cutscene, can still keep input unavailable after this action enables its own switch.

SetCharacterActionEnabled()#

Enable / Disable Character Action

Enable or disable a named interaction response on a character.

Source table from SetPlayerInputEnabled(), page 120
Option key / fieldMeaning and inputDefault
Character characterIdChoose a Character Designer ID; player is a runtime alias where supported.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 SetCharacterActionEnabled({"characterId": "player", "actionEvent": "", "enabled": true})

In use. Disable Talk for a character who is busy, then restore it later. The event/verb selection matters: disabling one response is different from hiding the NPC or turning off all interaction.

Page 120 of 378Permalink
Go to page