How can I show fragmented destruction on parts using in-game CSG?

I took a look at the the robloxdev site and found a blog post on in-game CSG and it included a video.

In this video an awesome tank which seemingly uses constraints (this is irrelevant but cool enough to point out) is shooting at other models/parts in the level. And the parts are being broken up into fragments as if it was being destroyed. I’ve been taking a look at the API and article for using it. But no matter how I try to wrap my head around it, while the API takes an array of parts to subtract or union, it only returns a single new instance. But this video shows what looks to be multiple parts.

I went on to the demo level, and even opened it in studio that showcases the in-game CSG API with a helper module to keep attachments and constraints. But even then breaking these parts down in fragments still made them operate as a single part.

How would I use the in-game CSG API to fragment like in the video with the tank?

Thanks for taking your time to read this. :grin:

4 Likes

Looks like something worth looking into. I actually didn’t know this even existed.

I personally don’t know how to do this yet, but have you perhaps tried applying the helper model rather than deconstructing it and making your own implementation for the time being? Seems like a better alternative for now to test waters before getting into the complexity of it yourself.

Are you using UnionAsync or SubtractAsync for this? If you’re using Union, try Subtract!

I think this is what you’re looking for.

5 Likes