Rigid one-way welds

I often want welds which satisfy the following properties:

  1. They are one-way, so only one of the welded parts has forces applied to it. I want this in situations where one of the parts has very sensitive physical behaviour (e.g. it is controlled by players or relies heavily on physics simulation) and needs to have its physics isolated from the other part.

    • An example of this is the scenario where you want to weld a chain of parts constrained to each other (such as a ragdoll) to a physics sensitive part, without messing up the latter part’s physics. Constraints do not form assemblies so the BasePart.Massless property has no effect, and there is no one-way forces option for BallSocketConstraints and other constraints.
  2. They are rigid, so the parts are always stuck together and do not detach unnecessarily. So they have the reliability of JointInstances and RigidConstraints (not AlignConstraints which are very unreliable).

    • This property is also necessary so that the parts are kept stuck together when replicated to other clients (and so when these other clients are making their own local modifications to one of the parts they do not detach from each other).

As far as I am aware, it is currently impossible to achieve this only with instances. JointInstances and RigidConstraints do not have an option for one-way force application, so they fail to satisfy property 1. The Align constraints do have the one-way option, but they are not actually rigid so they fail to satisfy property 2.

(One of the issues that may arise when with these kinds of welds is that the two parts may be prone to detaching from each other when one part is physically obstructed from moving to the correct location. So I’d also like to suggest exposing some information about whether the weld is in a detached state or not so that we can deal with those scenarios intelligently if we wish - I also want the same with RigidConstraints and AlignPosition/Orientation.)

Realistic Hand RP 🖐🤏 Without VR - Roblox is one of the projects I am working on which wants these kinds of welds. It has a lot of very finnicky physics-sensitive stuff going on which makes this sort of one-way weld isolation important.

2 Likes

As far as I can tell what you’re asking for is entirely equivalent to using a two-way weld but making the extra attached parts massless and using collision groups to disable their collision with any things you don’t want them colliding with.

If the additional parts are massless and don’t have any undesirable collisions then they won’t be able to “mess up” the main assembly in any way.

2 Likes

Yeah, all collisions are disabled in the particular scenario I am working on currently (we do have some situations where collisions matter but I’m okay for things to be a bit buggy there since those scenarios are rare).

However, as mentioned in the OP, constraint chains still put undesirable forces (gravity + other stuff I guess) on the assembly regardless of whether the parts have collisions enabled or not. And we can’t make the parts in the chains massless since they are each the root of their own assembly.

If collisions are disabled, we might be able to solve it by manually CFraming the entirety of the constraint chain on RenderStepped, though that means the constraint chain isn’t really simulating anything except gravity (we’d have to manually add movement-related forces to each of the chained parts I guess?)

I suppose one way to narrow this feature request would be just requesting an option for one-way forces on all constraints (such as BallSocketConstraints). That would solve the worst part of the problem for us.

Could you not use kinematic joints (Motor6Ds) to drive the extra attached chains?

Those joints have to be kinematic, in your proposed setup they would effectively just be kinematic joints regardless since they would not be making any contribution to the simulation.

1 Like

If we did that then we’d lose the physical simulation from the constraints, which is the reason we’re using them in the first place.

For example, in the particular case I am working on right now we have ragdolling character models using constraints to implement the ragdolling. And we want a player to be able to pick up other ragdolling character models without the player’s own character going haywire. And absolute physical rigidity between the player’s character and one part of the ragdolling character is required because this can happen in physically-intense scenarios which are too much for non-rigid constraints to handle without lagging behind or exploding.

We have a separate thing to handle what happens when the ragdoll itself explodes, but that’s a solution we wish to avoid in the common case since it disables the constraint chain’s simulation. We could extend our solution there to work with the Align constraints that we would be using as our one-way weld, but Align constraints seem to be more prone to detaching than BallSocketConstraints so it would result in the constraint chain’s simulation being disabled more frequently. It is a potential solution though - it’s just very fragile and hacky.

Being able to use stricter rigid joints would also simplify some replication related things. With weaker constraints there will be a lot of visual desync because different clients which have differing ideas about where players (holding objects) are in the world (because clients in our game need to make local modifications to the position of player characters). So we’d need to implement custom replication of held object joints (similar to what we already do for custom replication of characters). Using stricter joints means we won’t need to add that extra custom replication, and things will just be correct by default.