So I am new to scripting, I have little experience and was wondering if there was any way to negate a part in a script as you are able to do so in the model tab. If so, is there anything else for union? Please let me know and thank you.
You can use BasePart:SubtractAsync()
. It is basically the opposite of BasePart:UnionAsync()
.
local PartA = workspace.PartA local PartB = workspace.PartB --imagine PartB is within PartA local success, negatedPart = pcall(function() return PartA:SubtractAsync({PartB}) end) if success and negatedPart then -- if PartB was within PartA and it was a success on negating the part print("PartA has been negated through a script! :D") end