It’s hard to explain, but here’s a video:
- I subtract the yellow part by the red part. This operation is marked with SetWaypoint before and after.
- The result is subtracted by the red part using the same code. Like (1), I use SetWaypoint before and after.
- I undo in studio.
- I run the exact same operation as (2). I reliably get CSG error code -25 every time I try to do an operation involving this new part.
- Even studio’s builtin CSG tools fail when operations involving this part is done.
Here’s the code I’m running in the command bar:
game:GetService("ChangeHistoryService"):SetWaypoint("Test")
local A = game.Selection:Get()[1]
local B = game.Selection:Get()[2]
local result = A:SubtractAsync({B})
result.Parent = workspace
game.Selection:Set({result})
game:GetService("ChangeHistoryService"):SetWaypoint("Test")
And here’s a very easy repro. Running this code will reliably cause the error to happen. One interesting thing to note is that removing the :SetWaypoint() call near the end will prevent the error from happening.
local ChangeHistoryService = game:GetService("ChangeHistoryService")
local A = Instance.new("Part", workspace)
local B = Instance.new("Part", workspace)
A.Position = Vector3.new(0, 0, 0)
B.Position = Vector3.new(0, 0.5, 0)
-- Step 1
ChangeHistoryService:SetWaypoint("Test")
local result = A:SubtractAsync({B})
result.Parent = workspace
ChangeHistoryService:SetWaypoint("Test")
-- Step 2
ChangeHistoryService:SetWaypoint("Test")
result:SubtractAsync({B})
ChangeHistoryService:SetWaypoint("Test")
-- Step 3
ChangeHistoryService:Undo()
-- Step 4
-- Interestingly, removing this SetWaypoint call will
-- prevent the error from happening.
ChangeHistoryService:SetWaypoint("Test")
result:SubtractAsync({B}) -- Errors here.