I’m betting this probably won’t actually happen in practice, most likely it’ll just be collision based (e.g. if something hits a part and applies enough force the constraint will break, but it probably won’t calculate things like stress)
However, you could calculate stress between two attachments yourself. You’d just want to calculate the weight of each part (force of gravity) which is object.Mass * workspace.Gravity
, and then you can calculate the torque and force between both. This would be pretty expensive to do (A complexity of O(n^2)
) but the cost of the calculation would likely be pretty cheap, likely a dot product and some multiplication for each “connection” and you would only need to do this once!
As long as your models aren’t too complex you could manage, but, if you wanted you could avoid parts altogether and only use some RigidConstraints in the model, which would greatly let you reduce the number of things to calculate for, and maybe even make your simulations look more realistic/satisfying (little tiny parts that are part of a bigger object aren’t going to spray everywhere and make a mess when that wouldn’t happen irl anyways)
I don’t know what the actual math would turn out to be, but, like I mentioned really you would only need to calculate it once with the Roblox feature, and then you can use those calculations to update the RigidConstraint’s breaking thresholds dynamically (default break force minus stress forces), so it works at runtime too!
(When breaking parts off you would also need to update the thresholds for those parts’ connections again, so something which would break very easily at the start doesn’t continue to break easily if a lot of weight is removed)
What’s especially cool is that doing these stress calculations like this isn’t even the hard part, the hard part is collisions, and calculating forces and things, because Roblox doesn’t offer many ways to do this accurately, and in some cases its not really clear what the proper calculations are.
This is getting me very excited, and is reminding me a lot of Red Faction Guerrilla’s destruction, but modernized. I definitely would love to play around with this idea when and if they release it!