Skip to reading
GDScript Programming & Godot

SetInteractionApproachEnabled()

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 Automatic Interaction Approach

Set the global runtime approach-to-target behavior, including distance and whether to face the target.

Source table from SetInteractionApproachEnabled(), page 155
Option key / fieldMeaning and inputDefault
Automatic Approach Enabled enabledExplicit on/off state for the feature or response.true
Default Stop Distance distanceNumber; decimals allowed. Range: 0.0 to 20.0.0.35
Face Target After Approaching faceTargetOn/off.true

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

Code example
await SetInteractionApproachEnabled({"enabled": true, "distance": 0.35, "faceTarget": true})

In use. Enable walking up to interactive props, then choose a modest stop distance. If the player stops too far away, inspect both approach settings and the physical collider. The event volume is a separate object.

Page 155 of 378Permalink
Go to page