Hello Developers!
AASubtractor, or Axis Aligned Subtractor allows for fast axis aligned box on box subtracting. You may have seen a code dump for this a while ago, you can still find that post here still if you just desire the barebones cutting mechanics.
The idea
Currently Roblox CSG cannot be replicated onto the client; additionally Roblox CSG is very slow. This module aims to fix those problems and subsequently to make things like bullet holes, explosion craters, among other things within reach!
Basic Usage
To subtract one part from another the code is simply:
local Module = require(game.ServerScriptService.AASubtract)
local PartsTable, Model = Module.SingleSubtract(Object, Subtractor)
-- Will subtract 1 part from another
To subtract one part from a group of parts the code is:
local Module = require(game.ServerScriptService.AASubtract)
local PartsTable, Model = Module.GroupSubtract(List, Subtractor)
--Will subtract 1 part from a collection of parts
However you can input many more parameters to save you time and code
SingleSubtract:
local Module = require(game.ServerScriptService.AASubtract)
local PartsTable, Model = Module.SingleSubtract(Object, Subtractor, Parent, MakeModel, ModelName, KeepOriginalObject)
--Parent // Instance | Default = Object's Parent // is the parent of every part subtracted or the model if MakeModel is set to true
--MakeModel // Boolean | Default = false // determines if a seperate model is made for the subtracted part
--ModelName // String | Default = Object's Name // the name of the new model
--KeepOriginalObject // Boolean | Default = false // When subtracting parts the original object is left over,
--sometimes keeing it can be valuable
GroupSubtract:
local Module = require(game.ServerScriptService.AASubtract)
local PartsTable, Model = Module.GroupSubtract(Object, Subtractor, Parent, MakeModel, ModelName, KeepOriginalObject, CollectiveModel)
--Parent // Instance | Default = Object's Parent // is the parent of every part subtracted or the model if MakeModel is set to true
--MakeModel // Boolean | Default = false // determines if a seperate model is made for the subtracted part
--ModelName // String | Default = Object's Name // the name of the new model
--KeepOriginalObject // Boolean | Default = false // When subtracting parts the original object is left over,
--sometimes keeing it can be valuable
--CollectiveModel // Boolean | Default = true // When making the new parts it will bunch all of them
--together under one model when this is set to true; if not it every part subtracted will retain its own
--model. Identical behavior can be produced when looping through a list of parts and using :SingleSubtract()
Finally, here is the link to the modulescript!!
Please DM me any bugs or suggestions so i can improve this Module!