Why do my humanoids move to the next point even though they haven't completed the pervious one?

I’m making a tower defense game for my friend, all my code is working and is fine, but I’ve found one problem that makes no sense to me.

Here is my choppy way of showing the problem


And the farther the check point is the less accurate the path is. here’s a part of my code

Humanoid:MoveTo(CurrentPoint.Position) --- CurrentPoint stands for the current point the charater is moving to
Humanoid.MoveToFinished:wait() -- this should stop the loop until the character has finished moving to the point

For some reason it doesn’t finish going to the point all the way, how do i fix this?

https://developer.roblox.com/en-us/api-reference/event/Humanoid/MoveToFinished
If the Humanoid reaches its goal within 8 seconds, this event will return with reached as true. If the goal is not reached within 8 seconds the Humanoid will stop walking and reached will be false. This timeout can be reset be calling Humanoid:MoveTo again within the timeout period.

local moveto = humanoid.MoveToFinished:Wait()
repeat  
	humanoid:MoveTo(waypoint.Position)
	moveto = humanoid.MoveToFinished:Wait()
until moveto
4 Likes

Oh, okay I didn’t know that. thanks for the help, ill test out some ways of doing it

You’re idea worked, but it doesn’t work for my script so I edited it

repeat
	Humanoid:MoveTo(CurrentPoint.Position)
	local MoveCompleteBoolen = Humanoid.MoveToFinished:wait()
until MoveCompleteBoolen

Thanks for the help

1 Like