I’m making a game, and in the game there’s an npc who moves by 7 different positions in a order, for some reason, the :MoveToFinished() i added fires less than halfway through the way, my npc’s walkspeed is 2, when i set the enemy’s walkspeed to 16, it does it just fine, how can i fix this?
local zombie = script.Parent
for count = 1,#game.Workspace.WayPoints:GetChildren(),1 do
game.ReplicatedStorage.HP.Value = game.ReplicatedStorage.HP.Value - script.Parent.Humanoid.Health
EDIT: I just found out that it’s actually the :MoveTo() that for some reason ends early before reaching the wanted point.
EDIT 2: Setting WalkToPoint gives the same result, and setting WalkToPart does absolutely nothing.
So I tested your code and I think I know what’s happening. There is a “timeout” with the :MoveTo() function which is 8 seconds. If the npc cannot move to the position or part within 8 seconds it will give up.
But on Humanoid:MoveTo the code sample is really good and I would recommend using it to fix your problem.