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

How do I make a humanoid "wander"?

So for my RPG game I want to add animals that you can kill. I think it'd be boring if they never moved. So how do i make the humanoid walk around aimlessly?

1 answer

There is this perfect method for you: MoveTo (wiki) This script will make the animal walk randomly 50 studs around him every 5 seconds, just for an example.

-- animal will be the humanoid of the animal character
while true do
	animal:MoveTo(Vector3.new(math.random(-50, 50), 0, math.random(-50, 50)) -- change the Y positions to fit your game
	wait(5) -- set the time to wait
end

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