MoveTo() not working

Move to has failed to make the dummy walk to the specified destination

Example: https://streamable.com/5xfiy – Sorry for the no embed!

Currently, the only solution that I have found is to not use the humanoid to walk, and just have it teleport to the position, which is not my goal.

Script:

wait(10) -- so I have enough time to see it
local yes = game.Workspace.Dummy
local humanoid = yes.Humanoid
 
local aaa = game.Workspace.DummyArea
 
humanoid:MoveTo(aaa.Position)

print("moved") -- prints this, doesn't move the dummy though
4 Likes

Is the Dummy’s HumanoidRootPart anchored? This could be the underlying problem. Normally, it’s supposed to be unanchored.

3 Likes

You should use the PathFindingService for moving your object to a specific destination. The command MoveTo() has no purpose in this script of yours.

You can use this script:

local yes = game.Workspace.Dummy
local humanoid = yes.Humanoid
local PathFindingService = game:GetService(“PathFindingService”)
local aa = game.Workspace.DummyArea

local path = PathFindingService:CreatePath()

path:ComputeAsync(yes.Position, aa.Position)

Thank you lol, not sure why I didn’t check that. Thank you.

1 Like

It would create the path, and compute it, however, never would it move the character.
This is where Humanoid:MoveTo()comes in.
You index the waypoints you get by path:GetWaypoints(), and then make the humanoid walk to the waypoints.
You should also not assume that it doesn’t have a purpose in his script, because it does.
He simply wants the character to walk to the specified position, and you do not need to make it overly complex by using PathfindingService, when it’s likely just a simple straight line walk.
If the dummy needs to navigate more complex maps, then sure use PathfindingService.

2 Likes

Oh so if you want a humanoid to walk in a straight line then do you use the MoveTo() command? I never knew it was that easy.

1 Like