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

1 comment
Not what I ment but I fixed my issue. I was trying to randomly place parts over a plane.