Skip to reading
GDScript Programming & Godot

CharacterTeleport()

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

Character Instant Teleport To

Move a character directly to a target or coordinates without walking there.

Source table from CharacterTeleport(), page 115
Option key / fieldMeaning and inputDefault
Character characterIdChoose a Character Designer ID; player is a runtime alias where supported.Blank
Object Room sceneIdChoose a scene ID.Blank
Object (optional) targetIdChoose an entity in the selected scene. May be blank.Blank
XYZ positionDestination/placement coordinates as [X, Y, Z].[0.0, 0.0, 0.0]

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

Code example
await CharacterTeleport({
    "characterId": "player",
    "sceneId": "lab",
    "targetId": "archive_door"
})

In use. Place the player at a staged position before a scene reveal. Check the floor height and collider clearance; teleporting into a wall is still possible. Use Change Scene for a player room transition and Move NPC To Room for an NPC's room assignment.

Page 115 of 378Permalink
Go to page