NPC not moving like it's supposed to.(UNSOLVED)

The title is a little vague, but in the Developer Help article of “Moving NPCa between points” nothing moves, and there is no real animation.

I am using a Noob model (has everything I need) and I’ll show the script down below

local Noob = script.Parent
local NoobHumanoid = Noob.Humanoid

while wait(2) do

	NoobHumanoid:MoveTo(Vector3.new(Noob.PrimaryPart.Position.X + math.random(-10,10),-10,Noob.PrimaryPart.Position.Z+math.random(-10,10),-10))

end

If anyone can help me with this problem, please let me know.

Also, there are no errors in the output.

Updated Script:

local Noob = script.Parent
local NoobHumanoid = Noob.Humanoid

while task.wait(2) do

	NoobHumanoid:MoveTo(CFrame.new(Noob.PrimaryPart.Position.X + math.random(-10,10), -10, Noob.PrimaryPart.Position.Z + math.random(-10,10)))

end

(Returns error)

Also I think it is pretty weird, since Roblox showed a video demo on it.

Try using CFrame.new instead of Vector3. Sometimes I accidentally use Vector3 instead of CFrame and it doesn’t work. :person_shrugging:

try WaitForChild() when defining the humanoid, that could cause a problem

It returns Humanoid without using :WaitForChild() though?

It returns “Invalid number of arguments: 4” when I use CFrame.new()

is the problem occuring because of the vector3 you defined? im not entirely familiar with the syntax of vectors, but try moving it to vector3.new(10,0,10) or something like that.

just to test it

What’s with the extra -10 all they way at the end? There’s also an extra comma.

Just spotted it that issue, and I removed it but now it errors and says:

Unable to cast CoordinateFrame to Vector3

Now make it a CFrame.new

That’ll fix it.

No, I don’t think that is causing the issue

It is a CFrame.new() though.

filler

local Noob = script.Parent
local NoobHumanoid = Noob.Humanoid

while task.wait(2) do

	NoobHumanoid:MoveTo(CFrame.new(Noob.PrimaryPart.Position.X + math.random(-10,10), -10, Noob.PrimaryPart.Position.Z + math.random(-10,10)))

end

This code right here should work.

Same exact code, just without task.wait()? Doesn’t work, weirdly

all I can see from this is that its probably erroring from the way the cframe or vector is formatted, I have had this issue myself.

Oh.

30wordfillersrighthererightnow