How to make Breakable Glass

Yeah, sadly it is :joy:

If you’re not that much of a math wiz, I’ll try to find something easier for you. :sweat_smile:

1 Like

I looked at the picture in your original post. It looks like the eight triangular parts form out four rectangles:

PNG

I think you can find out the wedge parts’ width and height by subtracting the coordinates of the impact point and the x and y coordinates of the corners of the glass, since its dimensions are the same as the rectangles. Then, you just rotate the parts so that the crack aligns with the impact point.

Maybe, this would be easier for you?

In my opinion, this approach is harder to implement than the Fortune’s algorithm, because you have to do all the rotating, and positioning them so they all fit together. (The choice is up to you :slight_smile:)

5 Likes

I wanted to do it like you said, but I don’t what I’m gonna do with CFrame.

1 Like

F point is the position of the Orange rectangle
E point is the position of the blue rectangle
G point is the position of the Green rectangle
H point is the position of the purple rectangle

2 Likes

So, the triangles in the same rectangle has the same size and position.

2 Likes

I was thinking of the concept of not creating new instances of a wedge and then patch it up, making it look like the rectangular glass just broke, but instead actually cut up the glass so the rectangular glass actually ‘broke’

After quickly searching ‘cutting parts roblox’, I found this interesting post:

There’s a lot of solutions to that post, but the accepted answer was by @Syharaa:

Unfortunately, @EgoMoose’s roblox place for the answer is closed…

I found many alternate solutions other than @EgoMoose’s, like @Hexlinee’s, in the thread. And @skwoginc’s answer. Although I haven’t looked into all of them yet, but it’s worth looking into.

4 Likes

I think I should use the cut technology.
Bc it looks easier.

Bruh it’s hard.

1 Like

I guess I should make a handmade one.

1 Like

Maybe make the glass a model made by more parts and when .Touched, use BreakJoints function.

1 Like

Try to actually put some hard work in, and not pretty much ask for a ready-made script.

"Bruh that would will be very hard work.
Come on, Thousands of lines."

is not the right attitude.

The Scripting Support category is more of a place for asking others for help on issues you are facing or perhaps pointing you in the right direction, but it’s not a place to ask for others to write you working scripts.

2 Likes

A much simpler method to simulate breaking glass would probably to have the broken pieces in the frame with their transparency set to 1, cancollide false and all parts anchored then when it is broken get the script to remove the single intact glass piece then set the broken pieces transparency to the level you use for windows, set them to cancollide true and then unanchor them. This should give you the desired effect.

1 Like

I don’t want to make it like that because I don’t have a lot of free time on studio.
I have to go to school and study, so I can’t make it like that.

Also, This topic is not solved but I use the breakable window by using a simple script for another way to make it.

1 Like

I did what you said XD, This is the way I used. But I still want to know how to do the breakable glass on the topic.

made an example setup. In my example the glass breaks when touched Breaking Glass demo.rbxl (21.2 KB)

2 Likes

Heya, what @JinxFury18 suggested might be the easiest approach and you should try experimenting “Dividing” the part into 4 according to the impact.

Then, just convert the squares into triangles, Rotation according to the central point again.
Window

33 Likes

What a great idea! I think i’m just figured it out :slight_smile:.

3 Likes

How did you do that?!?! Can you tell me how more detailed, because that is what I am looking for!

4 Likes

I think this is a great way to do it, but how would you detect it, I’m trying to make breakable glass myself and can’t figure it out

By having a module for the glass, you could then call a function stating the point where it hit as well as the velocity of whatever you’re hitting it with (bullet, crowbar, sword, etc.). Then, you don’t have to handle necessarily detecting when its hit but rather calling the function when you know its hit.

Indeed, what jinxfury18 said is the easiest approach. However, let me explain to you the difficult way by showing you how “The Last of Us Part II” did this.
For those of you who played this, you would know that the creators of this game made the glass extremely satisfying compared to many other games. They created many different ways of the glass breaking for each method of attack, such as melee, throwable, weapons, etc.
Instead of having the glass break in real time, they made it seem like the glass was breaking real time. They made an effect. So, if you are going for a realistic approach, make an effect and not real time breaking. They had two layers of glass: Pane layer and debris layer. The pane layer gave the different sounds of the breaking glass to different sizes of glass. The debris layer is a mix of short and long glass debris. When you break it, it will all fall. As you see, this is an illusion. The player only sees the pane layer at first. When they finally strike the invisible pane layer, the pane layer makes the sound of breaking glass depending on the size of the glass, and then the debris layer will fall back by becoming unanchored.
I hope this helped for making a more realistic method and a performance efficient method.
Sincerely,
coolguyweir.

4 Likes