Why does the part anchor in mid air? I want it to anchor the moment it touches the ground. Also, I want it to anchor on top of a part if it falls on top of it. What is the solution? Here is a GIF of what it does: http://www.giphy.com/gifs/l2JhzIRAvRu8HOScw
while true do
Part = Instance.new("Part", game.Workspace)
Part.BrickColor = BrickColor.Random()
Part.Material = "SmoothPlastic"
Part.Position = Vector3.new(0, 128, 0)
Part.BottomSurface = "Smooth"
Part.TopSurface = "Smooth"
function onTouched(hit)
if hit.ClassName == "Part" then
Part.Anchored = true
end
end
Part.Touched:connect(onTouched)
wait(0.5)
end
Thanks!

2 comments
You could add a check to the if statement in the onTouched function to check if the hit name is Baseplate.
Sorry I did not mention I wasn't it to anchor if it falls on top of the other parts, I added it to my question.