The Developer Hub is now deprecated and information on this page may no longer be accurate. Instead, you should go to our new and improved documentation. You can also learn more about the future of documentation.
Collapse Sidebar


SubtractAsync creates new UnionOperation which occupies the same space as the part minus the space(s) occupied by the parts in the given array. It does this by invoking the real-time CSG solver. Similar to Instance/Clone|Clone, the returned object has no Instance/Parent|Parent set.

The following image depicts an example of a SubtractAsync operation: the yellow part on the left has SubtractAsync called with a table containing the two pink parts. The resulting UnionOperation is moved to the right, as it would otherwise overlap the original part and not be visible. Notice the missing concave pieces that match the spaces once occupied by the pink parts.

An example of a SubtractAsync operation: the left depicts a yellow part with two pink parts, which are then subtracted from the yellow part using SubtractAsync. The resulting UnionOperation is visible on the right
local yellowPart = workspace.YellowPart
local pinkParts = {workspace.PinkPart, workspace.PinkPart2}
local union = yellowPart:SubtractAsync(pinkParts)
union.Parent = workspace


Name Type Default Description

The objects taking part in the subtraction


The value of UnionOperation/CollisionFidelity|CollisionFidelity" in the resulting UnionOperation`


The value of UnionOperation/RenderFidelity|RenderFidelity" in the resulting RenderFidelity`


Return Type Summary

The resulting union from the subtraction operation