Skip to reading
GDScript Programming & Godot

FaceCharacter()

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

Face Character

Turn one character toward another.

Source table from FaceCharacter(), page 118
Option key / fieldMeaning and inputDefault
Character characterIdChoose a Character Designer ID; player is a runtime alias where supported.Blank
Face Character targetCharacterIdChoose a Character Designer ID; player is a runtime alias where supported.Blank

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

Code example
await FaceCharacter({"characterId": "player", "targetCharacterId": ""})

In use. Face Elias toward the player before his greeting. Select the acting character first and the target second. Turning alone does not bring them closer or guarantee a clear line of sight.

FaceObject()#

Face Object

Turn a character toward a scene object.

Source table from FaceCharacter(), page 118
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 targetIdChoose an entity in the selected scene.Blank

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

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

In use. Make the player face the signal lamp after using the lever. The target's position determines the facing direction; a large object's origin may not be the point you intended.

Page 118 of 378Permalink
Go to page