I am cloning items out of Replicated Storage, slightly up in the air. I would then like them to fall to the ground and become anchored once they hit the ground.
In the screenshot, you can see a gray box on the ground. Right now, I am spawning them within that boundary.
However, the items seem to think they have collided long before they actually do – and the items end up floating in the air.
clone.Parent = rocksOnMap
clone.Position = randomPos
local connection
connection = game:GetService("RunService").Heartbeat:Connect(function()
local touching = workspace:GetPartsInPart(clone)
if #touching > 0 then
for a, b in touching do
if b == playableArea then
clone.Anchored = true
--print(clone.Position.Y)
connection:Disconnect()
end
end
end
end)
Any ideas?