Spawn part on top of part

I want to spawn a part on top of a part.

local partSize = part.Size
newHero:PivotTo(spawn.CFrame + Vector3.new(0,partSize.Y,0))

This makes the part spawn higher.
What I want:
image

To spawn a part ontop of another with minimal overlapping, You can get both of the part’s Size/BoundingBoxSize (if its a model) and add both of them together after dividing by two.

Adding half of the bottomPart’s Height and half of the upperPart’s height will position it ontop, of course.

Part2.Position = Part1.Position+(Part1.Size.Y/2+Part2.Size.Y/2)

hope that helps!

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