Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My titan isn't walking to a part, what am I doing wrong?

Asked by
Aeike 9
6 years ago
script.Parent:MoveTo(41, 0.5, -1)

error: 20:07:14.506 - Unable to cast value to Object

its a script inside humanoid, what am i doing wrong?

0
Use Vector3 Programical 653 — 6y
0
This is why you check the wiki before using a function. User#5423 17 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

The MoveTo function requires a Vector3 argument.

script.Parent:MoveTo(Vector3.new(41, 0.5, -1))

You may be wondering why putting that is necessary. 41, 0.5, -1 are just three different numbers, not a position. So in certain arguments for functions, you may just need to put different numbers. When it comes to multiple numbers used as a Color,Vector,UDim and so on, you need to specify. What you will also notice is the amount of information you put into the arguements of these is equal to the number after them. So for example, Vector2.new() would need two arguments (x,y) while Vector3.new() would need three (x,y,z). Anyways, I hope I helped, have a good day!

Ad

Answer this question