Cut3r - A fun "shatter" and "slice" module using roblox's realtime CSG engine

,

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

RobloxStudioBeta_Qoblz9bs04

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.
image

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
RobloxStudioBeta_YBvm15tRoZ

Part shatter via bullets demo
RobloxStudioBeta_KpPBC5y3Du
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.
image

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

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.

59 Likes

You should try implementing this voronoi shattering using the voronoi diagram

this could help

3 Likes

Seems interesting, ill look into that thanks!

2 Likes

Is there any example for slice with lightsaber blades on the parts? I was looking for solutions to able to cut them in half or pieces but I tried to make slice part to follow the rotation and position from the blades but no luck…
here a gif:
https://cdn.discordapp.com/attachments/472424134165659651/1177027406050119760/RobloxStudioBeta_AtyXKViuYA.gif?ex=65837831&is=65710331&hm=df98b2abe699d5dbae3c41bb9d9c422bfe5d7117405af146b2393929240a4f51&

1 Like

For the slicing demo in the test place I just used the cframe of the slicing part

Maybe when a hit is detected, you would run

local BladeCframe = Blade.CFrame -- this would be the CFrame of the saber blade
Cut3r:Slice(TouchedPart,false,Blade.Cframe,100) --you can adjust the last value to something that works

the second value is set to false because if it set to true it would mess up the wanted result.

I am not too sure how this would work with your blade system but it is an idea nonetheless.

2 Likes

Thank you! I’ll test it out when I’m at home from work today.

2 Likes

Okay so yesterday I just checked it and I can’t figure it out to get it worked since your demo place doesn’t have any slice tool in starter pack folder but are you going update it to have slice tool included in the demo place?

Here’s an issue

local Cuter = require(game:GetService("ReplicatedStorage").Modules.Cut3r)
local block = script.Parent

local broken = false


block.Touched:Connect(function(hit)
	local char = hit.Parent
	if char:FindFirstChild("Humanoid") == nil then return end

	if broken == true then return end
	broken = true
	
	Cuter:Shatter(block, false, CFrame.new(0, 0, 0), 30, 4)
	
	
end)

Disconnect the Touched event before shattering.

Do i need to save it in a variable or… how?

Yes.

local c c = Touched:Connect(function()
    -- guard clauses
    c:Disconnect()
    -- shatter
end)

Why does it fire so many times?

Edit: I think it’s not disconnecting correctly…

oh this is a debugging thing on my end

ill disable it

image
The demo place has this, which is a slicing demo. The red thing is a “knife” and you can drag it around to position the slicer

2 Likes



I cant figure it out how to get it work…

you are refrencing saber.beam, which is a beam and not a part. try just the saber instance

1 Like

You have the f in CFrame lower case

1 Like

If I change from Cframe to CFrame and it show error like this

@Lucarkirb any idea to fix it? also Beam is a blade part…

That is strange. That’s an error with the module and since I don’t know how it works I don’t believe I can help you with it without looking at the code. Sorry

can you show me how you used :slice()?

1 Like