Combining 2 parts

i can get the correct position, but not the size
how would i get the size for a new part that has the size of these 2 combined so it will become this?
image

local Object1 = -- Path to first object
local OtherObjectTable = {--[[Path to second object]]}
local Object1Clone = Object1:Clone()
local Object2Clone = OtherObjectTable[1]:Clone()
local UnionOfClones = Object1Clone:UnionAsync(OtherObjectTable)
print(UnionOfClones.Size)
UnionOfClones:Destroy() -- Optional

i dont wanna use unions, just normal parts

Is what you want to do specific to one axis?

for now, yesβ€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž

i would want to have it as the green one though if i had it like this

local Object1 = -- Path to first object
local Object2 = -- Path to second object

print(Object1.Size.X, Object1.Size.Y, Object1.Size.Z + Object2.Size.Z)

this works thank youβ€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž

1 Like

how would i expand this to 2 axis’s or even 3?

print(Object1.Size.X + Object2.Size.X, Object1.Size.Y + Object2.Size.Y, Object1.Size.Z + Object2.Size.Z)

i have 4 parts, not 2

local ObjectTable = {} -- Put all your object paths into this table.

local SizeX, SizeY, SizeZ = 0, 0, 0
for _, Object in pairs(ObjectTable) do
    SizeX += Object.Size.X
    SizeY = Object.Size.Y
    SizeZ += Object.Size.Z
end
print(SizeX, SizeY, SizeZ)
1 Like

Just have a list of the containing parts, then make a for loop through the list:

local List = {workspace.Part1, workspace.Part2, workspace.Part3} --etc

local Object = workspace.Object
for i=1, #List do
	Object.Size += List[i].Size
end

Whoops looks like I’m a little too late

this would just make it a bigger cube btw

Thank you!β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž

1 Like