Skip to reading
GDScript Programming & Godot

SetControlSetting()

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

Set Control Setting

Change one supported runtime control setting with a value of the matching type.

Source table from SetControlSetting(), page 192
Option key / fieldMeaning and inputDefault
Setting settingChoose: enabled, cursorAdaptation, cyclingEnabled, movementProfile, autoSwitchInput, inputDevice, autoSwitchMovement, mouseProfile, gamepadProfile, touchProfile, proximityInteraction, proximityRadius, showHints, controllerIcons, coinEnabled, dragThreshold, gamepadLookSpeed."coinEnabled"
Value valueA value of the type required by the selected variable, operation or property.true

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

Code example
await SetControlSetting({"setting": "coinEnabled", "value": true})

In use. Set proximityRadius to a number or coinEnabled to a Boolean. The same Value box accepts different types depending on Setting; the text "false" is not the same as Boolean false.

GetControlState()#

Get Control State

Read the current control-profile state and store it in a game variable.

Source table from SetControlSetting(), page 192
Option key / fieldMeaning and inputDefault
Result Variable resultVariableName of the game variable that receives the returned value. Custom values are accepted.Blank

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

Code example
await GetControlState({"resultVariable": ""})

In use. Store controls_before before entering an inspection mode and inspect the returned state in a script. The result is structured state, not a single enabled flag or an automatic restore command.

Page 192 of 378Permalink
Go to page