Can I have 2 actors attached to one another, simulating physics?

Similar to this topic (which has no answers).

I would like the player to be able to remove the Lid of a Barrel (by smashing it or knocking it off). If the lid hasn’t been knocked off or destroyed, it should remain attached to the barrel, even if the barrel moves, etc.

I cannot get the lid to remain attached to the barrel while simulating physics on both. If I don’t simulate physics on the lid, I cannot perform hit detection.

So I’ll break this down into some simple questions:

  1. Can I have 2 objects be attached to one another, and both of them simulating physics? The barrel and the lid should not collide with one another.

  2. Alternatively, can I have the lid attached, not simulating physics, and still have it generate a hit event when hit by the player weapon?

  3. I have tried using overlap events (which obviously do trigger) - but how would I use this method, and have the overlap of lid and player weapon cause it to block, and also apply the appropriate physics to the barrel? ← the barrel should react as though the lid was hit and simulating physics.

I feel like I’m missing something fundamental here, and I thought this should be quite a straightforward problem, but I just can’t get anything to work.

Thanks

If both actors / components are simulating physics, they can be attached one to the other using a physics constraint. in the case of a lid, you probably want to set the constraint to block all translations and 2 out of 3 rotations so it acts like an hinge.
Physics Constraints are also breakable. You can set the maximum force/torque above which they brake or you brake them explicitly with Break Constraint.
After the constraint breaks the two parts will still simulate physics but become independent.

Thank you. I believe I just have a poor understanding of how the physics engine and constraints work.

I was attempting to attach the components together in the blueprint using “Attach component to component”, whereas I should have been adding the physics constraint to the BP, and adding my two components to that. I then locked all translation, and rotations with the exception of the one axis of rotation that I needed the lid to rotate on. It works just as intended :slight_smile:
Thanks again, Marco

1 Like