UnionOperation related functions return incorrect type

It returns “Instance” type instead of UnionOperation causing type errors if not casted.
image
image
I want to note that im talking about BasePart methods and not GeometryService

Expected behavior

For method to return UnionOperation instead.

Hey if you could share your script I can help look into it.
I tried the following script and it did print out UnionOperation as the class name.

local Workspace = game:GetService("Workspace")

local mainPart = script.Parent.PartA
local otherParts = { script.Parent.PartB, script.Parent.PartC }

-- Perform subtract operation
local success, newSubtract = pcall(function()
	return mainPart:SubtractAsync(otherParts)
end)

-- If operation succeeds, position it at the same location and parent it to the workspace
if success and newSubtract then
	newSubtract.Position = mainPart.Position
	newSubtract.Parent = Workspace
end

print(newSubtract.ClassName)

That odd cause for me it still returns Instance datatype
image

1 Like

This is purely a type issue, not actually a runtime bug.

1 Like

Oh I see what you mean. Thanks for reporting it! We’ll work on it.

1 Like