Is there a specific way to move unions?
because currently when moving a union it breaks it. (Changing its cframe in a script).
these are the changes being done to it:
local surfaceCfgs = {
Top = {Offset = CFrame.new(0, CELL_SIZE.Y/2 - .5, 0), Angle = CFrame.Angles(math.rad(90), 0, 0)* RelativeRotation},
Bottom = {Offset = CFrame.new(0, -CELL_SIZE.Y/2 + .5, 0), Angle = CFrame.Angles(math.rad(90), 0, 0)* RelativeRotation},
North = {Offset = CFrame.new(0, 0, -CELL_SIZE.Z/2 + .5), Angle = CFrame.Angles(0, 0, 0)* RelativeRotation},
South = {Offset = CFrame.new(0, 0, CELL_SIZE.Z/2 - .5), Angle = CFrame.Angles(0, 0, 0)* RelativeRotation},
East = {Offset = CFrame.new(CELL_SIZE.X/2, 0, 0), Angle = CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))* RelativeRotation},
West = {Offset = CFrame.new(-CELL_SIZE.X/2 + .5, 0, 0), Angle = CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))* RelativeRotation},
}
-- the templates are unions
local template = if (state == "Solid") then SOLID_SURFACE_TEMPLATE else OPEN_SURFACE_TEMPLATE
local newSurface = template:Clone()
-- THIS LINE -- Causes all the issues, when removing it unions dont obviouslly move but they dont breal.
newSurface.CFrame = CFrame.new(cellCenterPos) * surfaceCfgs[name].Offset * surfaceCfgs[name].Angle
Unioning these new moved parts always cause errors. In play testing (manually) copying then going to non playtesting (Also manually) and then also unioning by BasePart:UnionAsync({Parts}) or with geometry service.
Where am I going wrong?