Hi! Help me with function MoveTo. This function work fine but when i use it my npc always teleportation on marker without stopping how to do to my npc teleportation only one time?
I suppose you added the function inside a while loop, an onupdate or another event kicking regularly. If you place the function in a code chunk only executing once, the teleportation will only happen once.
I suppose you added the function inside a while loop, an onupdate or another event kicking regularly. If you place the function in a code chunk only executing once, the teleportation will only happen once.
Surelly the problem is the registerforupdate function being called too often, that's the part of the code you should check. By the way, not related to this, it's better to use registerforsingleupdate. Even when you use unregisterforsingleupdate, if scripts are slowed, onupdate instances could acumulate, something that didn't happen with registerforsingleupdate.
Surelly the problem is the registerforupdate function being called too often, that's the part of the code you should check. By the way, not related to this, it's better to use registerforsingleupdate. Even when you use unregisterforsingleupdate, if scripts are slowed, onupdate instances could acumulate, something that didn't happen with registerforsingleupdate.