Skip to reading
GDScript Programming & Godot

FollowCharacter()

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

Follow Character

Start one character following another with a chosen spacing and speed.

Source table from FollowCharacter(), page 117
Option key / fieldMeaning and inputDefault
Character characterIdChoose a Character Designer ID; player is a runtime alias where supported.Blank
Character to Follow targetCharacterIdChoose a Character Designer ID; player is a runtime alias where supported.Blank
Distance Behind distanceNumber; decimals allowed.0
Speed speedMovement speed; 0 uses the normal movement speed where supported.0

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

Code example
await FollowCharacter({"characterId": "player", "targetCharacterId": "", "distance": 0})

In use. Have Elias follow the player at about 1.5 units. It starts a continuing behavior; the next list instruction need not wait for a final destination. Stop the follower before a staged conversation if both actors must hold their marks.

StopFollowCharacter()#

Stop Follow Character

Stop the chosen character's follow behavior.

Source table from FollowCharacter(), page 117
Option key / fieldMeaning and inputDefault
Character characterIdChoose 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 StopFollowCharacter({"characterId": "player"})

In use. Call it before walking an NPC to a specific scene marker. It stops the following relationship; it does not remove the character or disable future movement commands.

Page 117 of 378Permalink
Go to page