Joint break force and break torque?

Is there a way to set a DOTS Physics joint’s break force and break torque? I’ve been playing around with the Unity Physics Package v0.3.2 but I don’t see a way to set these. Am I missing something or is this feature not available yet? Is it a planned feature?

Or is there a relatively efficient workaround for doing it through code?

Scenario: I’m making destructible buildings composed of smaller building blocks (PhysicsBody, PhysicsShape), connected together by fixed joints in DOTS. I’ve been able to procedurally generate those buildings and joints successfully with DOTS and it performs well. Currently the buildings just sway like jello when they are hit, since the DOTS joints seem to have infinite break force/torque. If I only join a small percentage of the building blocks to their adjacent neighbors, nice organic crack lines appear when the building is hit, but they don’t break off if they have any joints on them. (See attached gif)

5767333--607717--ecs_building.gif

Yes right now you would have to write a custom SimulationCallback to handle breaking on your own. We’ll be adding built-in support for this in the near future but no specific ETA yet.

Still doesn’t exists?

You can specify max impulses in joints through both the built-in authoring and the custom authoring components and have them trigger ImpulseEvents when the max impulse is reached.

See the Joints - Parade sample scene in the PhysicsSamples project for an example.

Note that for disabling the joint you need to write some code that actually disables it when the impulse event is received in an IImpulseEventsJob

1 Like

Hi @daniel-holz!

I am destroying joints in runtime when detecting impulse events, by deleting the joint entity and the bodies stop being jointed as expected.
The problem I found is that the joint has “EnableCollisions” off, but after deleting the joint, the two rigid bodies still don’t collide with each other. Is this value being cached somewhere in the physics world?

Even manually changing the value of EnableCollisions in the PhysicsConstrainedBodyPair in runtime doesn’t really seem to do anything. Is there any way to update that?
I think it makes sense in most cases to re-enable collisions between two rigid bodies when the joint is gone. I am using Unity.Physics 1.3.0-pre.4, with Havok Physics backend, without any of the incremental broadphases.

Interestingly, switching to Unity Physics backend it works fine (bodies start colliding after deleting the joint)

Oh, that is very interesting. That value might be cached then and not updated within the Havok integration.
Would you mind filing an official bug through the issue intake system for this and post the issue ID here?

1 Like

Here is the reported issue ID:
IN-83732

1 Like