Cego.FollowCharacter

From Adventure Game Studio | Wiki
Revision as of 13:29, 3 June 2021 by Hobbes (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

FollowCharacter is a cool and powerful function in AGS. But if you don't disable it, it can lead to freezing your game. If you code a character to change room (Cnpc.ChangeRoom(x)) while following another character (specially in Rep_Execute) it'll most likely loop the game continuously.

The way to stop a character to follow another is simple:

Cnpc.FollowCharacter(null);