Why actors toss each other when simulate physics is on?

It looks like your hat has a closed collision. Have you looked at it in the static mesh editor?

EDIT: The quick answer is to set the collision to complex ( for the hat ).

314535-2020-09-22-11-33-47.gif

Hello,

I’m trying to use simulate physics option on both actors in my project. I ran into a problem. As you can see in the gif the actors toss each other after I play it.
They do not overlap.
Could it be a problem with the collision? Or the settings of physics? Any other idea how to solve it?

They do not overlap.

As mentioned above, if you did not explicitly create convex collision, these objects are overlapping and the physics depenetration will eject any intersecting geometry.

For this to work OK-ish, you’d need a spherical collider on the pin, and convex shape on the hat.

The quick answer is to set the
collision to complex ( for the hat ).

Apart from the fact that it would not work as one cannot simulate physics for complex collision. You can simulate against static complex collision but that would not work here; it’s the hat that is being simulated.

To generate convex, simplified collision that can be used in a dynamic physical simulation, open the mesh and:

Play with the settings in the bottom right to get things right. You can visualise it like so:

314560-screenshot-2020-09-22-153532.jpg


Alternatively, you can hand-craft the collider in an external application and opt out of generating an automated simplified collision when importing the model. Yet another option is to make the collider manually in the editor out of primitives but it is a royal pain the neck.

1 Like

Thank you! That solved the problem :slight_smile:

Another question that relates to this. What if I use a convex destructable mesh instead of a static mesh and I want to put a static mesh inside the destructable mesh? For example I hide a key inside a box that needs to be smashed in order to get the key. It seems that the convex collision not working when destructable mesh is used instead of a static mesh. Is there a direct solution to this?

You can definitely hand-craft hollow collision. It’s just 6 flat boxes after all. I don’t think the Convex Decomposition tool can do that on its own - not for a fully hollow object with something rattling inside.

How is this translated into a destructible mesh? It isn’t - the destructible will replace the collision with its own thing. After all, you’re dealing with a lot of new geometry after the fracture, and it all has to be taken into account.

For example I hide a key inside a box
that needs to be smashed in order to
get the key.

I wouldn’t even bother with crafting collision for this.

  • have a static mesh box and turn it into destructible
  • make an actor (so it can have its own functionality) hosting the destructible component
  • have the static mesh key inside with no physics simulation (why simulate that you cannot see [edit: a glass box, duh!])
  • when the destructible is fractured, start simulating key physics (if needed)

Image from Gyazo

Yet another way to approach it, is to create the destructible dynamically. When the chest is hit with enough damage, you replace the static mesh with a destructible mesh, fracture it and only then spawn the key. No need to waste memory on things that may never get smashed.

Thank you again!