How to Change Rigidbody from 1 to Infinity if Something Happens?

Hey guys.

I have a game object made from 6 rigid body game objects. They are all attached to each other with fixed joints. I want it to fall a part if ‘A’ happens. Which it does and works fine.

In the inspector I have the Break Force set to 1 so that it will fall apart when ‘A’ happens.

If ‘B’ happens I don’t want it to fall apart. I would like for the game object to stay completely in tact.

What’s the best way of doing this? I’ve looked through the rigidbody docs but haven’t found anything.

My thinking is to set the fixed joints to infinity when ‘A’ happens, via code. But I’m not sure if you can do this or how.

Any ideas or pointers?

Thanks in advance!

Im not sure why you would need to? If A doesnt happen then it wont fall apart right? Or are you talking about an instance where both A and B happen? If this is the case, then put in a override that states if A and B happen then do nothing.

I did something similar. Increasing break force is the way I did it.

I don’t know how your game object is suppose to move but break force of 1 is very small. It may break apart.

I would give a reasonable break force to objects then,

destroy all fix joints if A happens (if you can find them)

Increase break force if B happens