TweenService ignores humanoid.MoveToFinished:Wait()

Hi there! So I’m currently working on a pathfinding script, something similar to operators demo by Cishshato. And there’s a problem. I’m tweening the primary part of the NPC after the :MoveTo() is finished. However, it just ignores the fact that there’s a MoveToFinished and just teleports it after the moveto began. Without the tween, it works fine. Any ideas why?

print("walking to waypoint "..num)
movingTo = waypoint.Position

humanoid:MoveTo(movingTo)
local reached = humanoid.MoveToFinished:Wait()
if not reached then humanoid:MoveTo(movingTo) end
			
print("finished walking to waypoint "..num)
			
local tween = game:GetService("TweenService"):Create(startPart, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Orientation = waypoint.Orientation})
tween:Play()

(startpart = primarypart btw)

1 Like

this is in a for loop right?

you are missing a moveToFinished on your movement retry and a tween.Completed:Wait()

1 Like

Yeah that worked I’ll blast myself off of this planet :skull:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.