1

i've made a simple pot model inside blender: such skills wow

So the idea is that after importing to unity, generating mesh collider, adding ridgin body i would like to be able to put smothing inside the pot. Now it's generating collider but without a "hole" inside, so if i throw smth inside it just bounce off the top. Is there any way to do it simple way? I'd like to avoid making a collider by hand in unity, using cubes and so...

Image overview: enter image description here

Pan Wolodyjowsky
  • 388
  • 6
  • 26

3 Answers3

2

Your collider needs to be concave

It isn't clear from your question how you're "generating mesh collider," but the results are clearly generating a convex collider.

That said, some things to know about mesh colliders (and concave ones even more so): They are very compultationally heavy to calculate, so they should never...

  • move
  • scale (especially non-uniformly)
  • rotate

...at runtime.

Alternatively you can use multiple box colliders in the same orientations as the side-segments of your can (along with one or two for the bottom, depending on how small of an object you'll be dropping inside).

Community
  • 1
  • 1
2

Uncheck the generate collider box from the import settings, add a mesh collider component and check convex.

comphonia
  • 521
  • 3
  • 10
1

I would use four or six box colliders for the walls of the pot and another for the floor. You can scale each box collider along each axis, but if you want to rotate a box collider you will need to give it a parent and rotate the parent. Box colliders are very low cost for the physics engine compared to mesh colliders.

Wayne R.
  • 26
  • 1