I am trying to spawn these parts randomly across a bigger part. When I do it spawns them off the platform. Some are near / touching the platform but most are off it.
Here is the code
local amt = 10 _count = 0 while _count < amt do local model = script.Parent.Basic.Value:Clone() model.Parent = script.Parent model.PrimaryPart = model.Primary local DesiredCFrame = CFrame.new(math.random(0, script.Parent.Size.X)+script.Parent.Position.X, model.PrimaryPart.Position.Y+script.Parent.Position.Y, math.random(0, script.Parent.Size.Z)+script.Parent.Position.Z) model:SetPrimaryPartCFrame(DesiredCFrame) _count = _count + 1 end
An easier solution would to apply spawn locations across the platform. To do so, go to the 'model' tab on the top of the page, and near the top right, you'll see 'spawn'. Click that and you'll have yourself a spawn location where players will spawn at. I would recommend putting at least 3 spawners across the platform so that players don't pile up on top of each other.