How do I make a object break on impact?

  1. What do you want to achieve? I want to be able to slam a object against the ground and have it break. For example, I pick up a box and I drop it from a high place then I want it to break.

  2. What is the issue? I cant seem to figure out how to do this,( of course). but at first I was thinking I could measure the force on impact and if its above a certain amount it could break. I’m not sure if this is possible, I’m fairly new to scripting.

  3. What solutions have you tried so far? I have tried to measure the magnitude from the object to the ground to see if I could make it break if it was a certain a certain distance from the ground. This didn’t work because it measures the distance from the middle of the ground and not right below the object.

So in conclusion, I want to be able to slam something or drop something on the ground and have it break.

any help is appreciated!!

Compare his velocity magnitude right before impact

3 Likes

so then how will they do that?

1 Like

I can’t help him if he can barely script.

1 Like

so do I measure velocity and magnitude then compare them?
I’m sorry I’m terrible at scripting.

you can show him how to do that?

So I’m gonna give you the easiest way since you said you weren’t good at scripting.
Basically make sure the part that you want to break is unanchored, put a script in it and inside of that script copy and paste this code:

local partToBreak = script.Parent

partToBreak.Touched:Connect(function()
     partToBreak:Destroy()
end)
1 Like

is there a way to make it break on impact, or is it to complicated?

I just sent you the easiest way of doing it, did you try it out?

yea but it just disappears as soon as you run the game. But its okay, thanks for your help. I will just try to figure it out on my own.

Thats a really easy solution. Set the part to anchored by default and then when you want to drop it set it to unanchored so it falls down.

This is something right on the breaking edge still in the game development world. It’s simply too complex and time consuming to do in real-time, the closest work being done surrounds soft body physics (every object in the world has a certain level of elactisity etc.). What we have instead is solid geometry and textures to represent objects.

To achieve what you’re looking for check out: Solid Modeling | Roblox Creator Documentation

1 Like