Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Humanoid:MoveTo movements are not working right?

Hello, I am making 15-20 NPCs walk randomly between points. But, after a few seconds, the movements get less smooth and jittery.

Video

Code

for i, point in pairs(waypoints) do
		script.Parent:MoveTo(point.Position + Vector3.new(0,3,0))
		local move = false
		script.Parent.MoveToFinished:Connect(function()
			move = true
		end)
		script.Parent.MoveToFinished:Wait()
	end

Any help is appreciated thanks

2 comments

0

Consider using Humanoid.WalkToPoint instead.

0

Since you are already waiting for the event to fire on line 7, connecting to the event is kinda redundant.

1 answer

I found a workaround. If you set the waypoint distance to a higher number, and you use a line of code to wait just before the NPC gets to the destination, some stuttering happens but it is very minimal.

This discussion is preserved as it was. New answers, comments, and votes are closed.