The issue is that I am unsure of how to calculate the sizes/positions of the parts to position the next part to be in front of the last part. I tried the following code, but it only works if the parts are of the same size:
local Part = game.Workspace.Worlds.Overworld.ImportantParts.StudParts["Start"]
local Start = game.Workspace.Worlds.Overworld.ImportantParts.StudStart
Part.Position = Start.Position - Vector3.new(0,0,Part.Size.X/2)
I have searched 25+ dev forum posts and even tried the Roblox Assistant, but I have not found any luck with these resources. I may be overlooking it, but any guidance on this issue of mine is greatly appreciated.
You should calculate the offset based on the size of each part and subtract it from the position of the previous part to position the next part in front
Edit: try making a variable where you want to stack the parts (you use z axys)
local Part = game.Workspace.Worlds.Overworld.ImportantParts.StudParts["Start"]
local Start = game.Workspace.Worlds.Overworld.ImportantParts.StudStart
local offset = Vector3.new(0, 0, Part.Size.X / 2) -- here you stack the parts along the z-axis
local newPosition = Start.Position - offset
Part.Position = newPosition
I tried your example, and it does not work as I need. Part1 should not overlap with part2. It seems it is positioning the parts based on the pivot point. (Which is not what I need)