Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to move NPCs in a straight line?

Asked by 5 years ago
Edited 5 years ago

I’m making a tower defense game and I made a for loop where the NPCs use MoveTo() from path1-path10 the problem is that I when the NPCs get to a point, they don’t fully stand on it, making them walk diagonal to the next point. Is there any fix to this?

Edit: would I have to move path1-path10 back a little?

0
I don't know what you mean by "they don't fully stand on it". Unhumanly 152 — 5y
0
"The reach goal state of a humanoid will timeout after 8 seconds if it doesn’t reach its goal." Is it taking longer than 8 seconds for the NPCs to reach the point that you set for them to walk to? Unhumanly 152 — 5y

1 answer

Log in to vote
0
Answered by
b3wz 34
5 years ago

https://developer.roblox.com/en-us/api-reference/function/Humanoid/MoveTo

Try reading up on this, as it will help you. There is an event called "MoveToFinished" that might help you in moving to the next point after completing a move.

Ad

Answer this question