animated objects and collision

I am working on a big button the player has to stand on, the button goes in the ground so there is a hole under it. The button is a model with a animation and it looks like I can’t use generate mesh collider for the object as the player fall trough the model.

The only information I could find about animation is character animation, so do I need to use simple colliders for my animated objects? Or is something wrong and should it be using my mesh generated collider?

A MeshCollider can’t collide with another MeshCollider unless at least one of them is marked as convex (see here for details). If both the button and the character are non-convex MeshColliders, they will pass through each other.

But my player is a rigidbody sphere with a sphere collider :slight_smile:

So lets asume I have a double door thats 1 mesh and is animated to move both doors at the same time.
Its impossible to have a mesh collider on it and have it move as the doors open/close, a collider is always static in its shape?

That would mean I have to make 2 separate doors with their animnation and own box collider instead of a mesh collider to make it work the way I like it in unity?

The shape of the collider is the same as the “resting” position of the animation. It doesn’t change shape along with the visible mesh geometry.

Yes, you would use a script to move the doors, each with its own BoxCollider.

I found out I can attach box collisions to the bones so I don’t have to cut my 2 doors into seperate files :slight_smile: