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

Why does this keep giving me an error?

Asked by 8 years ago

Says Unable to cast double to Vector3. I don't know why.

model:MoveTo(math.ceil(eventMouse.Hit.X*100), math.ceil(eventMouse.Hit.Y*100), math.ceil(eventMouse.Hit.Z*100))

Tell me if I need to explain something more

1 answer

Log in to vote
2
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago

You forgot to put the numbers in the Vector3 constructor.

model:MoveTo(Vector3.new(math.ceil(eventMouse.Hit.X*100), math.ceil(eventMouse.Hit.Y*100), math.ceil(eventMouse.Hit.Z*100)))

Hope this helped.

0
thanksssssss Operation_Meme 890 — 8y
0
No problem. Pyrondon 2089 — 8y
Ad

Answer this question