PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

SubtractAsync

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

Parameters

Name Type Default Description

The objects taking part in the subtraction

Default

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

Automatic

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

Returns

Return Type Summary

The resulting union from the subtraction operation