Home > database >  Unity mesh collider isn't colliding with other objects, 2D game
Unity mesh collider isn't colliding with other objects, 2D game

Time:01-09

I've made a mesh from an SVG in Blender and converted it to a mesh. I then put it into Unity, to put a collider on it, the mesh does not collide with anything, even with convex ticked.

Here is my collider:

Collider

And here is my mesh in Blender (blue is the outside of the mesh):

Mesh in blender

What the convex collider looks like:

Convex collider

Can someone tell me why the collider is not working? Cheers!

CodePudding user response:

When working with Colliders and 2D, make sure you have the following:

  • RigidBody2D
  • Collider2D

and when scripting, ensure you are using OnCollisionEnter2D(Collider2D col){}

CodePudding user response:

The MeshCollider is implemented in the 3D Physics engine and therefore incompatible with the 2D Physics engine. They simply don't interact.

What you probably want to use instead is the PolygonCollider2D

  • Related