I want to create a random room generator and I keep getting this error message with a line of code:
Unable to cast double to Vector3
NewRoom:MoveTo(EndofOldRoom.Position.X, 0.05, EndofOldRoom.Position.Z + 18)
I would love if roblox’s error messages were less vague, but I have to resort to the devforums because “
Unable to cast double to Vector3” makes absolutely no sense.
You need to use
MoveTo() takes a Vector3. you need to do this:
local pos = Vector3.new(EndofOldRoom.Position.X, 0.05, EndofOldRoom.Position.Z + 18)
Not every function has an overload taking each Vector3 component individually, MoveTo does not.
Thanks guys, now it works! I just needed to put Vector3() around it…
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.