Skip to reading
GDScript Programming & Godot

SetInteractionMode()

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 Interaction Mode

Choose the runtime hotspot interaction style, including context, verb, direct, cycling cursor and verb-coin variants.

Source table from SetInteractionMode(), page 190
Option key / fieldMeaning and inputDefault
Interaction Mode modeChoose: context, verb-single-click, verb-double-click, verb-direct, verb-direct-double-click, direct, cycling-cursor, verb-coin, verb-coin-first."context"

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

Code example
await SetInteractionMode({"mode": "context"})

In use. Use verb-coin for a compact interaction menu. Changing the mode does not create missing verb responses on objects. Test empty-ground clicks, inventory combinations and the device the player is actually using.

SetAutoInputSwitching()#

Automatic Input Switching

Enable or disable automatic input-device switching.

Source table from SetInteractionMode(), page 190
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 SetAutoInputSwitching({"enabled": true})

In use. Turn it on for a game that should adapt between mouse and gamepad. Turn it off during a fixed-device control demonstration. Device detection and movement-profile switching are related settings, not the same switch.

Page 190 of 378Permalink
Go to page