Humanoid:MoveTo Turning way earlier

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want the humanoids to follow a certain path to the end.

  1. What is the issue? Include screenshots / videos if possible!

The humanoids are supposed to follow the red line but they aren’t

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Yes i have, I could not find any information there.

Is there anyone that knows a fix to this? If yes, please let me know.

May you provide some scripts so I can help base my answer off of it?

1 Like
-- Ofcourse i am defining the Part variables too but i left those out to save some space

_G.wave = function(zombieType, numberOfZombies)
	for index = 1, numberOfZombies do
		spawn(function()
			local ZombieClone = game.ServerStorage.Enemies[zombieType]:Clone()
			ZombieClone:SetPrimaryPartCFrame(CFrame.new(game.Workspace.Start.Position))
			ZombieClone.Parent = game.Workspace.Enemies
			ZombieClone.Humanoid:MoveTo(Part1.Position)
			ZombieClone.Humanoid.MoveToFinished:Wait()
			ZombieClone.Humanoid:MoveTo(Part2.Position)
			ZombieClone.Humanoid.MoveToFinished:Wait()
			ZombieClone.Humanoid:MoveTo(Part3.Position)
			ZombieClone.Humanoid.MoveToFinished:Wait()
			ZombieClone.Humanoid:MoveTo(Part4.Position)
			ZombieClone.Humanoid.MoveToFinished:Wait()
			ZombieClone.Humanoid:MoveTo(Part5.Position)
			ZombieClone.Humanoid.MoveToFinished:Wait()
			ZombieClone.Humanoid:MoveTo(Part6.Position)
			ZombieClone.Humanoid.MoveToFinished:Wait()
			ZombieClone.Humanoid:MoveTo(Part7.Position)
			ZombieClone.Humanoid.MoveToFinished:Wait()
		end)
		wait(1) 
	end
end

This is the script i am using currently, Found it on another devforuming post and slightly modified it.

I don’t exactly know how to use _G or spawn(function()s yet, but I think that it has something to do with the CanCollision on the enemies that might be pushing each other.

Actually that’s not the problem, Those are off. They just turn out of nowhere randomly. Even when i only spawn in one zombie.

I have also found out this problem only occurs when the walkspeed is under 3 studs a second.

I am honestly clueless then on how they’re getting off the path. I’m sorry.

Alright, Thanks for your time though.

You’re welcome, 0f_h3 I hope you find your solution!

1 Like

I have actually found the problem. Humanoid.MoveToFinished:Wait() times out if it takes longer than 8 seconds to reach the destination. The path part was 20 studs long and the walkspeed was 1, so it would take 20 seconds.

Ah, okay! Glad you found out the problem! I knew it had to do something with the MoveTo, just wasn’t sure. Enjoy your day!

1 Like