Help with humanoid movement

So, I’ve been trying to make a script where a rig moves towards 2 certain blocks. (1 after the other.) the problem is, the script I have made does not work whatsoever.
I have anchored the humrootpart so the character can’t be pushed around.
The script just activates when you join for now.

local p1 = game.Workspace.NPCMovePoints.MovePoint1
local p2 = game.Workspace.NPCMovePoints.MovePoint2
local walk = script.Parent.Humanoid.Animator:LoadAnimation(script.Parent.Animations.run)

walk:Play()
script.Parent.Humanoid:MoveTo(p1.Position)
script.Parent.Humanoid.MoveToFinished:Wait()
walk:Stop()
wait(3)
walk:Play()
script.Parent.Humanoid:MoveTo(p1.Position)
script.Parent.Humanoid.MoveToFinished:Wait()
walk:Stop()
2 Likes

try this

local p1 = game.Workspace.NPCMovePoints.MovePoint1
local p2 = game.Workspace.NPCMovePoints.MovePoint2
local humanoid = script.Parent.Humanoid
local walk = humanoid.Animator:LoadAnimation(script.Parent.Animations.run)

walk:Play()
humanoid:MoveTo(p1.Position)
humanoid.MoveToFinished:Wait()
walk:Stop()
wait(3)
walk:Play()
humanoid:MoveTo(p2.Position)
humanoid.MoveToFinished:Wait()
walk:Stop()

An anchored character can’t move using humanoid move methods (i.e. ‘MoveTo()’).

Solution is to unanchor the character, or use tweening to move the character.
Unanchoring is probably the easiest option.

Oh, yeah, I mistyped the code. The second move point was supposed to be MovePoint2. But the problem still is that it won’t move at all. Not even to the first spot.

I haven’t anchored the whole model. I have anchored only the HumanoidRootPart so players can’t push it around. It can still animate like normal.

I thought that if I anchored the humrootpart, it wouldn’t be able to be pushed. That was right, but it didn’t move.

Anchoring a single part of a model has the same effect of anchoring the entire model. As they’re all connected with Motor6Ds.

1 Like

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