Skip to reading
GDScript Programming & Godot

SwitchCharacter()

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

Switch Character

Change the currently controlled playable character.

Source table from SwitchCharacter(), page 149
Option key / fieldMeaning and inputDefault
Active Player characterIdChoose a Character Designer ID; player is a runtime alias where supported.Blank

Timing. Awaits the character-switch routine.

Code example
await SwitchCharacter({"characterId": "player"})

In use. Switch from Ivo to another character after confirming that character is configured as playable. The new character can have its own room, inventory, HUD and journal settings. It is not a command to swap the visible model on the same actor.

IsCurrentRoom()#

Is Current Room

Test the current room through the adventure extension and return the result.

Source table from SwitchCharacter(), page 149
Option key / fieldMeaning and inputDefault
Scene sceneIdChoose a scene ID.Blank

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

Code example
await IsCurrentRoom({"sceneId": "lab"})

In use. Use it from a script that reads the returned Boolean. An ordinary action list does not branch on the result. In visual scripting, choose If Current Room when you want visible True and False paths.

Page 149 of 378Permalink
Go to page