Humanoid:MoveTo() gets stuck

Part1 = Green Part
Part2 = Yellow Part
Part3 = Blue Part
Part4 = Pink Part

  1. What do you want to achieve?
    I want the character to move to part1 then part2 then part3 and at last part4

  2. What is the issue?
    The character gets stuck
    image

  3. What solutions have you tried so far?
    I tried using pathfinding service, but it stops in it place and don’t move, and nothing appears in the output.

Script
In the character:

local humanoid = script.Parent.Humanoid

humanoid:MoveTo(workspace.part1.Position)
humanoid.MoveToFinished:Wait()
humanoid:MoveTo(workspace.part2.Position)
humanoid.MoveToFinished:Wait()
humanoid:MoveTo(workspace.part3.Position)
humanoid.MoveToFinished:Wait()
humanoid:MoveTo(workspace.part4.Position)
humanoid.MoveToFinished:Wait()

Thanks for reading! :smiley:

1 Like

Well you need to use pathfinding in order for this to work, if you have problems making one just follow one of the thousands of tutorials out there

I tried, but it would break and stop in it place

Well then send the code that you were using so we can fix that problem

local pathfindingService = game:GetService("PathfindingService")

function makePath(target)
	local path = pathfindingService:CreatePath()
	path:ComputeAsync(script.Parent.HumanoidRootPart.Position, target)
	local waypoints = path:GetWaypoints()
	for _, way in pairs(waypoints) do
		script.Parent.Humanoid:MoveTo(way.Position)
		script.Parent.Humanoid.MoveToFinished:Wait()
	end
end

makePath(workspace.part1)
makePath(workspace.part2)
makePath(workspace.part3)
makePath(workspace.part4)
1 Like

It breaks because i have a random maze generator, when the maze is generated, a character spawns, and follows the players, but, it sometimes break, and sometimes walk then stop.

So there are no errors in the output?
And is there more code than this? Because this code seems fine to me. If there is more code please send it

no thats it, but the character is big, and it breaks when moving, i wanted to use another method than pathfinding service, or an advanced way in it, if you want, i can give you the roblox place file to see yourself.

" IM USING ANOTHER PLACE WITH A RANDOM SMALL MAZE "

So this means a normal sized character works fine? I dont really know how to fix this though

the small character works fine using pathfinding, but a bigger one does not

1 Like

Hang on i just found a post that might help you

But, even when using a small character, and pathfinding, i want him to go back with the parts, like this:
image

Okay thank you, ima check on it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.