Skip to reading
GDScript Programming & Godot

SetObjectInteractionApproach()

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

Override approach behavior for one object, or inherit the global behavior.

Source table from SetObjectInteractionApproach(), page 156
Option key / fieldMeaning and inputDefault
Object Room sceneIdChoose a scene ID. May be blank.Blank
Object / Character entityIdChoose an entity in the selected scene.Blank
Approach Override modeChoose: inherit, enabled, disabled."inherit"
Stop Distance (0 = global) distanceNumber; decimals allowed. Range: 0.0 to 20.0.0.0
Face Target When Override Is Enabled faceTargetOn/off.true

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

Code example
await SetObjectInteractionApproach({
    "sceneId": "lab",
    "entityId": "archive_door",
    "mode": "inherit"
})

In use. Give the door its own enabled approach mode and a close stop distance. A small distance cannot move the character through an oversized blocking collider. Set collider dimensions independently in the object's collision settings.

Page 156 of 378Permalink
Go to page