Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a Humanoid Move?

I'm making an NPC move, but I get an error saying 'Unable to cast double to Vector3'. Here's the code attempted:

workspace.Robin2[""].Humanoid.WalkToPoint = Vector3.new(211.5, 21.5, -1.35)
workspace.Robin2[""].Humanoid:Move(211.5, 21.5, -1.35, false)

what does it mean? Need some help!

1 comment

0

in your second line its MoveTo, theres no vector and idk what that false is doing there

1 answer

Use the function :MoveTo().

Humanoid:MoveTo(Vector3.new(0, 0, 0))

The humanoid will attempt to walk to the Vector3 position provided. It'll attempt to, but if there are objects in the way, you won't be guaranteed that the Humanoid successfully reaches the Vector3 provided.

2 comments

0

I tried, the 1st error has gone, but a new one has come up saying 'Unable to cast value to Object'

0

It's because you put "false" in there, I'm assuming. :MoveTo() takes two arguments at maximum, the first being a Vector3 value, and the second being the part to move the Humanoid to. It's saying that it's expecting that you put a part as the second argument, but is finding a boolean instead, which is why it throws an error. Why are you putting a boolean there anyways(if you are)?

This discussion is preserved as it was. New answers, comments, and votes are closed.