I would like to show you something I have been working on for a week (in which I had the idea in mind long ago)!
It’s a type of glass shatter I have made. The way it shatters is that it makes a straight line from the hit/click position to every corner, as well as the closest point to every edge. Essentially creating 8 right angled triangles (using WedgeParts of course). This is my very first creation (and post) that I have showcased onto DevForum. And to my knowledge, I am the first person to make this type of glass shatter (according to quick searches related to glass shatter, other than my own post in ScriptingHelpers long ago)
The shattering will work anywhere you click on it, not just on 1 face of the glass.
If you would like to test this out yourself, here is the game link
I would like to point out a few things:
The script errors (but doesn’t break) if you click and immediately move the mouse outside of the glass (returning a nil error in console).
If you spam click fast enough, you are able to duplicate the shards of glass.
The glass object itself cannot have any rotations, otherwise the shards are not correctly created (not for self really, since you guys are only testing it).
I have a sort of realism suggestion; The audio that plays contains what I think is glass pieces falling. I suggest cutting it right before the glass falls.
(Also, i do have major hearing loss so i could be completely wrong, apologies if so.)
Oh, alright. Well initially I didn’t add audio because I wanted to showcase just the creation of the wedges, so audio wasn’t a priority. But I guess I could cut off the audio so you don’t hear the glass falling. Thank you though.
No, sorry. Not sure if you can find some resources for it as I just did all of this without any internet (also took me a lot of time). My code is not optimised as seen in the little notes I sent at the end of the post.
Best of luck if you ever plan on making it for yourself!