New Physics Class: RigidConstraint

woah this could be amazing, super usefull!

4 Likes

that’s a lot good physics class this feature but yes i agree with that suggestion lot of time with that simple for RigidConstraint

3 Likes

Thanks, this will be “fixed” mid next week.
Unfortunately the dragger’s behavior still won’t be excellent until we replumb some backend dragger code - this is planned for a bit later.

6 Likes

will you be able to select a model and make it attach everything with rigid constraints?

3 Likes

useful and very wanted feature, was rather annoying there was no weld-ish type constraint that actually used attachments.
just hoping if i attach characters to the rigid points they dont burst with resistance when the constraints broken alike with the existing alternatives
it would be useful if we can set attachment0 to be dominant/ignorant since situations like this are annoying where they conflict with eachother (and often fling into the void)
VhFfBO3XfJ

11 Likes

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!

3 Likes

I bet this happens due to the assembly root being changed, or something being recalculated in the assembly. Maybe if you set the root priority of the staff in your gif higher it may resolve this effect? (I guess shoot me a PM if you have anything further)

1 Like

I’d love to see more practical examples. With constraints for beginners they often find it to all the same. Practical examples and a .rblx file would be great

1 Like

This is not targeted to builders but to programmers. And it’s very useful!

2 Likes

Yes, this is correct but even more physics bugs will occur (in different areas) if I set the weapon to not be Massless, which conflicts with the priority table. Afaik I do not have the leeway for it.

3 Likes

This is a funny way to weld things together, I can’t wait to see what I can use this for. I love playing with physics and constraints.

2 Likes

Really? Because I’m a scripter and I barely understand this.

I mean just look my display name :eyes:

1 Like

This is amazing. I can imagine setting up a skeleton frame and creating modular rooms with ease. It’s like better welds.

1 Like

This could be very useful for Skinned Meshes, do RigidConstraints work with bones as well?

1 Like

To be honest, from the sample video I just see some parts CFraming to the 3D location you clicked. I don’t see an use in this. :face_with_raised_eyebrow:

1 Like

It’s extremely useful and a good use case has already been provided in the OP which is attaching accessories to characters via attachments. RigidConstraints can snap an accessory’s handle to a character’s head by the attachments without you having to write excessive boilerplate.

I made a post about attaching items to characters’ hands using attachments and it’s been quite a well-received post. Link to that here. One of the big problems is that this is dependent on two things: matching attachment names and a Humanoid which will internally create the welds for you.

There are also developers who don’t have Humanoids in their custom characters meaning the engine doesn’t handle snapping for them or their attachment points are different and therefore will not automatically snap. Check out this support thread, this developer wants to add accessories the same way Roblox does but they don’t have Humanoids. RigidConstraint would resolve their problem right away over using the weld code I supplied as the solution post.

5 Likes

Pretty awesome! About to try it out now with a wall I was putting together.

1 Like

If I understand, this will be useful for things like sticky bombs on moving objects, right?

You have to read the post as well. The main feature of this new constraint has yet to be released:

Yeah this is definitely big. It previously was very annoying and performance heavy to try and get more accurate demolition - using constraints not designed for that and desperately performing velocity and mass checks to get destruction was, while acceptable, definitely not as fun or intuitive as a simple force-based constraint breaking system.

Constraints were the best thing added to roblox and they only get better. It’s clear attachment-based constraints really modernized roblox and will continue doing so!

1 Like