How to make a part shattering script

How can I make a script that when you collide with a part it’s shatters in parts and the shatter pattern is randomly generated

like this but when you touch it

Thanks for the help!

3 Likes

The best way to do it depends on whether that part is anchored (not moving) or not anchored (moving).

If anchored, have all the ‘pieces’ in a model, just iterate over the model and unachor each piece.

If not achored, then the pieces should be welded. Just destroy the welds.

Generally, something most people does with shatter is have a full piece that’s visible, and when it’s time to shatter, hide that piece and show the pieces (before doing what I stated above)

Take a look at This/these threads:

This was a part of snack break 28, EgoMoose’s challenge:


These might not be exactly what you are looking for but it might give you a better idea of how to go about your problem.

1 Like