Humanoid:MoveTo() not working, unrelated to HumanoidRootPart

So i tried making a humanoid:MoveTo() but it just refuses to work no matter what i do.

Ive tried several solutions but all mention the HumanoidRootPart, which has no issues and ive checked several times, even with a previously functional humanoid.

Similarly, i’ve failed to use Humanoid.WalkToPart and it doesnt work either.

If anyone has any experience with this issue please help.

4 Likes

Too uninformative. First, can you show the source code of the original way you tried using the MoveTo() function? Second, show a video (if possible) of how it doesn’t work (ex: not moving after running), if you can’t, describe how it is when you press run?

Make sure that the npc isn’t connected to the ground, or welded to other parts.

Usually what I do is lift a character .1 stud above the ground if I plan to have them walk around.

I used

while script.Disabled == false do
	script.Parent.Humanoid:MoveTo(script.Parent.HumanoidRootPart.Position + Vector3.new(math.random(10,-10), math.random(10,-10), math.random(10,-10)))
	script.Parent.Humanoid.MoveToFinished:Wait(2)
end

It doesnt work because nothing happens,
and when i press run nothing happens.

I know it isnt connected to the ground because i can move it with my own character.

I attempted that but it didnt seem to work, im confused as i can for certain check its not welded to anything.

is any part of the NPC anchored? if so, unanchor it

Why are you checking if the script isn’t disabled because even if it was it wouldn’t be able to check because it’s disabled?

Your issue is that when your adding Vector3 values to your position you also have it adding to the Y value (up or down) which means it has a chance to tell it to go 6 feet up or -3 feet down, when it can’t, therefore the issue.

Try this:

script.Parent.Humanoid:MoveTo(script.Parent.HumanoidRootPart.Position + Vector3.new(math.random(10,-10), script.Parent.HumanoidRootPart.Position.Y, math.random(10,-10)))

Disabled scripts, anchored parts, all things I checked before I got here. That script didnt work and neither did the Humanoid.WalkToPart you can set

You didn’t read my solution to the entirety of it’s content. Read it again.

I read your solution to the entirety of its content and implemented all changes you suggested. No change happened.

Then there is something wrong with your humanoid or code, try this refactor (clear your code and replace it with this) If it doesn’t work, it’s something 100% wrong with your Humanoid model.

local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local Root = Character.PrimaryPart
local RandomValueRange = 10 -- // Change this to whatever you want (no -# values)

local function Move()
	Humanoid:MoveTo(Root.Position + Vector3.new(math.random(RandomValueRange*-1,RandomValueRange), 0, math.random(RandomValueRange*-1,RandomValueRange)))
	Humanoid.MoveToFinished:Wait()
end

-- // Could put in while loop or whatever you wanna do
Move()

Worked for me just fine.
Edit: fixed something that could’ve been problematic

2 Likes

thank you but overall nothing is working, it could be a problem with the humanoid but
image
image
(this is both i tested it on)
humanoid properties are fine, i have no idea what to do at all augh

(HOLD ON NEVERMIND SOMETHINS GOIN ON FAITH RESTORED

after further testing the second one i used it on worked but not the first which is nice but i need to look into whats wrong with the first because thats what im trying to code

You never mentioned that you were using a non-character humanoid (Roomba, assuming it’s quite literally the robot vacuum counterpart)

Here’s some potential solutions and things you should do to it, since it isn’t a rig.

  1. Weld constraint should be something like Part0: Head | Part1: HRT (humrootpart)
  2. All parts that are welded to the HRT should have these properties changed
  • CanCollide = false (IMPORTANT)
  • Anchored = false (IMPORTANT)

That should be why it wont move.
Also it probably is but make sure the Roomba group’s primary part is the HRT

trust me it was stupider than that, i forgot to set the primary part. it managed to work.

also yes, it is the robot vaccum.

1 Like