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

Why is this not :MoveTo() script not working?

Asked by 10 years ago
Model:MoveTo(script.Parent.Position.x,script.Parent.Position.y+1,script.Parent.Position.z)

OutPut

09:24:18.051 - Unable to cast double to Vector3

1 answer

Log in to vote
0
Answered by
Thetacah 712 Moderation Voter
10 years ago

Very easy fix here. You need to Set the MoveTo() to be a Vector3. MoveTo requires a vector3, simply add in the Vecto3.new() in the MoveTo's parentheses.

The Move() functiontakes two arguments, the model that's going to be moved(It's there if you add the :) and the Vector3value of where the model should move to.

To fix it just look at the code down below.

Your code should look like this:

    Model:MoveTo(Vector3.new(script.Parent.Position.x,script.Parent.Position.y+1,script.Parent.Position.z))

Ad

Answer this question