Is there any way of changing the position of a model randomly?

I’ve been trying to change the position of a model randomly but I can’t find out how.

Here is the script that I have:

while true do
	task.wait(0.1)
	local ss = game.Workspace["Solar System"]:Clone()
	local pos1 = math.random(1,250000)
	local pos2 = math.random(1,250000)
	local pos3 = math.random(1,250000)
	local WhereItShouldGo = Vector3.new(pos1,pos2,pos3)
	ss:MoveTo(Vector3.new(0,0,0))
	ss.Parent = game.Workspace.Planets
end

There are 3 ways i know of to move a Model:
MoveTo
PivotTo
SetPrimaryPartCFrame
PrimaryPart.CFrame = CFrame (same as SetPrimaryPartCFrame)


You are also forgetting to apply the random values

ss:MoveTo(Vector3.new(pos1,pos2,pos3))

or

ss:MoveTo(WhereItShouldGo)
1 Like

Thay all keep spawning in the same position