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

Unable to cast double Vector3 error, How would I fix?

Asked by 9 years ago

I am trying to make a script that moves rooms along by 25 studs, but I get an unable to cast double vector3 error. Help?

    local clone = rooms[math.random(1, #rooms)]:Clone()
    clone.Parent = workspace
    local cur = val*25
    clone:MoveTo(0, cur, 0)

2 answers

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

MoveTo takes a Vector3 value as an argument, rather than three numbers:

clone:MoveTo(Vector3.new(0, cur, 0))
Ad
Log in to vote
0
Answered by 9 years ago

I figured this out, I'm fine now.

Answer this question