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

,

Oop!! I forgot to reply to this x.x but I think it’s triggering by pressed mouse left click so I think have to figure it out how to toggle it when not using it…

1 Like

This looks really nice

Do you by chance know if using the real time CSG would be more or less performant than creating wedges for just a thin glass plane?

I really like this. I reckon this can be used to shatter meshparts followed by a fading effect. I didn’t know you could do this with CSG nor have I ever attempted but this is amazing and thank you soo much for your amazing work :smiley:
To improve the module I would reccomend using this snippet at the top of the code.
I think it’s useful to have a comment of example usage in the module. Also their may be performance gains by using --!native for those who have the beta feature enabled.

--!native 
local Cut = {}
--[[welcome to Cut3r
		
		This is offical release 1.
		


]]

local Settings = {
	--toggles
	OverrideLimits = false,
	--Limits
	IterationLimit = 100,
}
--Example usage
--local Cut3r = require(game.ServerScriptService.Cut3r)
	--Cut3r:Shatter(hitPart,false,cosmeticBulletObject.CFrame,120,1)

I thought I could improve it with a metaobject instead of cloning parts but was instead informed how CSG works

local metaobject={Size=.01,9,9,CFrame=CFrame.new(0,0,0),
Material=Enum.Material.Neon,
Transparency=1,
}
 Unable to cast value to Object  -  Server - Cut3r:51
  19:13:08.987  Stack Begin  -  Studio
  19:13:08.987  Script 'ServerScriptService.Cut3r', Line 51 - function internalCSGSlice  -  Studio - Cut3r:51
  19:13:08.987  Script 'ServerScriptService.Cut3r', Line 143 - function Slice  -  Studio - Cut3r:143
  19:13:08.987  Script 'Workspace.Block.Script', Line 4  -  Studio - Script:4
1 Like

You are trading off performance for realism and the “fun factor”. Cut3r relies on the performance that roblox provides with real-time CSG, so if your game doesn’t require that much realism, I suggest doing the wedge method for glass instead. Hope this helps!

1 Like

Ooh, thanks for the suggestion!

As for the metaobject thing, yeah roblox’s csg system requires the instance to be real.

1 Like