Hello!
While developing my game I ran into an issue, it’s not game breaking but it ruins the experience to say so. Please read the whole post to understand the situation.
This part is gonna be long.
Context
For some context, I am making a FNAF fangame. Basically if this helps in any ways, this is how I do basic « movements »
game.ServerStorage.NextNPC:Clone().Parent = game.Workspace
game.Workspace.PreviousNPC:Destroy()
This works perfectly fine.
Now the Animate script the npcs have is the normal one, nothing really important that was changed except me removing the emote/chat part of the script.
How it works is basically, (callback to the « movement ») when one has been cloned, it goes to a part using MoveTo
and MoveToFinished
. When for example, I want to test the path, I just put one from ServerStorage
, put it in Workspace
Then press Run in studio to see how it looks. When I do that everything works fine.
MoveTo script (based on memory):
local sun = script.Parent --sun is just a name of the character
local hum = sun:WaitForChild("Humanoid")
hum:MoveTo(PartA.Position)
hum.MoveToFinished:Wait()
--goes on
The problem itself:
Problem
Let’s say I’m play testing my game. Sometimes, some NPCs will stop after being on a part. So for example, one npc has 3 parts, a,b and c. When sometimes it will just go to A like normal, then do nothing. Just stand there. In my OutPut I don’t think there’s any errors.
I could share the script in its entire form (to get names).
It seems some NPCs will perfectly do their MoveTo
function. While some, sometimes will just stop at the first part or do the function perfectly.
I can share video footage, (while writing this I am in a bit of a rush).
If there’s any questions or forgotten details, please let me know.