How to cancel a humanoid:MoveTo()?

Ive seen so many people say that the solution is to do humanoid:MoveTo(HumanoidRootPart.Position) but that doesnt work for me. Im trying to cancel a moveTo midway. So while the npc is walking towards a position, when certain conditions are met i want it to just stop. But everytime i use moveTo to make it stop, it fires AFTER the previous moveTo is finished.

Is there any way to actually cancel a moveTo()?

EDIT: Turns out humanoid:MoveTo(HumanoidRootPart.Position) did work, i just fired it after the moveTo was finished (didnt realise it was firing after :man_facepalming:)

Maybe

Humanoid:Move(Vector3.zero)

no thats the same, it keeps going to its destination and THEN it will stop

Referring to the Roblox Documentation, MoveTo will cancel in the following cases:

  • The character arrives at its destination. There is a ~1 stud threshold to account for various humanoid speeds and framerates.

  • The character gets stuck and the eight-second timer expires.

  • The value of either Humanoid.WalkToPoint or Humanoid.WalkToPart changes.

  • A script calls Humanoid:Move() with a new moveDirection parameter.

  • A script changes the CFrame property of the RootPart.

So calling :MoveTo(HRP.Position) should work fine, just tested it myself as well. Might it be a frame rate issue on your machines side?

1 Like

i think you’re misreading @Tavikron 's solution as another MoveTo (look again! :magnifying_glass_tilted_left:)

it’s the Move method, not MoveTo

1 Like

Try this:

Humanoid:Move(Vector3.yAxis)

You just need to call Humanoid:Move with anything other than Vector3.zero.

yeah i know and i tried it. Does it work for you?

yeah ur right, i messed up on my end. All this time i was Accidentally firing ít after the previous moveTo was finished

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