I am trying to move a model to a random position using math.random() but for some reason I get an error saying "Unable to cast double to Vector3" here is the code:
while PizToClone <= Piztobe do
local copyPizza = Pizza:Clone()
copyPizza.Parent = workspace.Pizzas
copyPizza:MoveTo(math.random(198, 210), 231,math.random(31,41)) --This is the line giving me trouble
print(copyPizza.Position.X, copyPizza.Postition.Y, copyPizza.Position.Z)
PizzaCounter += 1
print(PizToClone)
print(PizzaCounter)
end

1 comment
Not too familiar with :MoveTo() but doesn't it take a Vector3 as its argument? ex copyPizza:MoveTo(Vector3.new(math.random(198,210), 231, math.random(31, 41))) doc: https://developer.roblox.com/en-us/api-reference/function/Model/MoveTo