Cut3r - A module for breaking things using CSG
Github Repository - Roblox Marketplace - Tech Demo - Install instructions - Documention
RELEASE 4 NOTES
Release 4 + Hotfix 1
Added
- Constraint preservation using the new Geometry service.
Known issues:
-
Structures sometimes keep their form after being shattered and unanchored. This is mostly a Roblox physics engine problem, but one way to get around is to code some external forces to nudge the structure to crumble.
-
Shatter doesn’t shatter properly. [FIXED in R4 - Hotfix 1]
Do you ever want to break stuff
I got a module that does that!
Cablilites
- Slice parts and unions in half!
- Break and shatter parts into shards!
Obtain, install and use
You can use it to break glass realistically, make concrete crumble into pieces or even cut parts and union operations in half!
To install, you can grab the module from the GitHub repo,
Or grab it from the Roblox marketplace for free!
I recommend you put the module under server script service, but its up to you.
You can read up on how to use Cut3r on the wiki
Install instructions - Docs (READ THIS!!!)
DO NOTE: Cut3r is not OOP, unlike most module scripts. It is made to be a backbone or a standalone module.
You can use it for an OOP module like a glass-breaking system, for example, that is what i do with one of my games.
More demos
Part slicing demo
Part shatter via bullets demo
Implementing that into my game
https://youtu.be/w2W9KThMAuQ
A small demo tutorial
Small tutorial from the wiki
Lets learn how to use the shatter feature of cut3r.
In a part of your choosing (Make sure it’s not a mesh part or a corner wedge or truss, since they are unsupported), Add a script and a proximity prompt.
Then make sure Cut3r is where you want it to be like server script service.
And then double-click the script to edit and now we can start scripting.
To start, lets require Cut3r
local Cutter = require(game.ServerScriptService.Cut3r)
Then we would connect the proximity prompt’s triggered event, along with the shatter function from Cut3r
script.Parent.ProximityPrompt.Triggered:Connect(function()
Cutter:Shatter(script.Parent,true,CFrame.new(0,0,0),100,2)
script.Parent.ProximityPrompt.Enabled = false -- this is to stop the proximity prompt from breaking.
end)
Explainaton:
parts = Cut3r:Shatter(Part:Instance,UseCFrameOffset:boolean,CFrameOffset:CFrame,Extension:number,ExtraIterations:number)
Part
is a part or union operation.
UseCFrameOffset
is a boolean, when set to true, Cut3r would use CFrame:ToWorldSpace()
(about CFrames), else Cut3r would use regular cframes
CFrameOffset
is the CFrame in question. If you want to rotate the slicer to get a different angle, use CFrame.Angles()
CFrame.Angles(). If you had UseCFrame Offset to false, you can just use a regular CFrame to position the slicer.
Extension
is the extension of the slicer. This should be bigger than your part.
ExtraIterations
is how many more times Cut3r is going to “break” each part. We recommend limiting this to four because this is exponential and might cause lag at high numbers. We also find that 1-2 is a sweet spot for most cases.
We recommend reading the wiki - Documentation
Extra goodies
I have left a tech demo place both on Roblox and in the GitHub repo for you to play and experiment in! The Roblox place is uncopy-locked, so you can load it up on the studio and play around.
Plans
- Use of new CSG features - Implementing Constraint preservation as well as performance improvements.
- CellShatter - Implementing voronoi fracture for more solid objects (Cut3r - A fun "shatter" and "slice" module using roblox's realtime CSG engine - #2 by 3_F7)
- Cut3r plugin - allows you to prebake shatter effects or make shards
One more thing
Please report bugs via GitHub!! Its easier to track issues there. You can still leave suggestions and thoughts in the replies.
LICENCE
Cut3r is open-source, which means that you can use it for free! I don’t require any credit, although a small name-drop somewhere would be nice.
Cut3r is under the GNU General Public License v3.0, so when you make any modifications to Cut3r’s code and you want to release it, the modification must be free and open-source as well.
YOU ARE NOT ALLOWED to sell Cut3r or any modded or variant of it.
HOWEVER, you are still allowed to use it in any commercial project, like a monetized game for example.