part:SubtractAsync does not work in game

i used subtract async to cut part in my game, and the code is on server side with no error
bu it does not change anything
here is the code:

local Negate = script.Parent.Negate

local Tar = script.Parent.Part

--local LN = Instance.new("Part", workspace)

--LN.Anchored = true

--LN.CFrame = Negate.CFrame * CFrame.new(Tar.Size.X / 4, 0, 0)

--LN.Size = Vector3.new(Tar.Size.X / 2, Tar.Size.Y, Tar.Size.Z)

--LN.BrickColor = BrickColor.new("Royal purple")

local RN = Instance.new("Part", workspace)

RN.Anchored = true

RN.Material = "SmoothPlastic"

RN.CanCollide = false

RN.CFrame = Negate.CFrame * CFrame.new(-Tar.Size.X / 4, 0, 0)

RN.Size = Vector3.new(Tar.Size.X / 2, Tar.Size.Y, Tar.Size.Z)

RN.BrickColor = BrickColor.new("Royal purple")

local success, newUnion = pcall(function()

return Tar:SubtractAsync({RN})

end)

newUnion.Anchored = false```

You forgot to parent newUnion to workspace since :SubtractAsync() returns the union without setting a parent.

5 Likes