Models spawning in side of each other

the models should be cloned and placed next to each other but the 2nd 3rd and 4th model always spawn inside of each other while the other ones work fine

local maps = {
	game.ServerStorage.maps.empty,
	game.ServerStorage.maps.hill
}

local pos = -65

for i = 1, 10 do
	local r = maps[math.random(1, #maps)]
	r:Clone()
	r:Clone().Parent = workspace.currentMaps
	r:PivotTo(CFrame.new(pos, 7.711, -1) * r:GetPivot().Rotation)
	pos = r.PrimaryPart.Position.X - 100
end
1 Like

you’re cloning it twice lol

for i = 1, 10 do
	local r = maps[math.random(1, #maps)]
    local clone = r:Clone()
	clone.Parent = workspace.currentMaps
	clone:PivotTo(CFrame.new(pos, 7.711, -1) * clone:GetPivot().Rotation)
	pos = clone.PrimaryPart.Position.X - 100
end

maybe the size of the model is more/less than 100

1 Like

thanks it works it wasnt the size i didnt realize it was cloning twice

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.