constraining bricks on house with fixedJoint

I am looking to build a destructable building made up of cloned cubes. obviously when placing this duplicated prefab and stacking them into a house format like legos, they dont hold together very well and the whole building will fall like a house of cards.

So I am trying to figure out a way to stack and connect these blocks together and will only break apart under a certain amount of force or large object slamming into them without destroying the rest of the house in the process.

My idea is to use the fixedJoint method and applying a breakForce. I am just not sure how to handle impacts and determine if the breakForce value has been met to break the fixedJoint contraint.

I realize this would be with the OnCollisionEnter(), but it seems the values I can get from the colliding rigidBody does not clearly work with fixedJoint.

Any suggestions on how I can set this up?

Thanks a lot

Some of the joints (not sure about fixed joints though) have a parameter that causes them to break, that way you just have to have a rigidbody hit it with enough force and it’ll break :slight_smile: No coding needed what so ever :slight_smile:

would you be refering to breakForce? it is included in fixedJoint (I mention fixedJoint over the other Joint method due to its relevancy to my situation) so your saying to just setting breakForce for the constraint in my start() function is all thats required and rigidBody will handle checking if enough is applied on impact? Good to know.

Thanks a lot