Make a mesh

I am not really sure if this has been answered but, I imported a model into unity. I go to put a mesh collider on it and there is no mesh for the object. It there a way to make a mesh for it in unity? Thanks for your help!

3 Answers

3

Yes, your your model does have a mesh, that’s what makes it an object, a model, a mesh with a renderer so you can see it. Check the import settings on the model : alt text

Now I don’t have Unity 4.x, so going by Unity 3.5 :

  • Go to the import settings of your model.
  • Check the Import Colliders option

now the problems you’re going to have with the mesh collider not working are backface culling, not detecting collisions from one side. The quick fix to this is to make the mesh collider convex. Now this creates a new problem … you cannot enter the tunnel, the mesh collider is covering the opening. There is no easy way for what you are doing, you are just going to have to manually set up colliders. The best way would be to make some long thin box colliders and place them around the surface of your tunnel. Then you will be able to enter the tunnel, and from the inside collide with the walls to not go out, and from the outside collide with the walls to not go in. This is exactly what Aldo is describing in his answer.

If there is a better way to import a mesh with a concave collider that works, then there is probably an answer out there if you search. I havn’t seen one though, perhaps someone who works alot with models can give a better solution.

Thanks alot!!! I got it now.

If your model is a character, don’t use a mesh collider: add CharacterController or a simple collider like a capsule, sphere or box to the model, and adjust its dimensions to roughly encapsulate the main parts of the body.

No it is a tunnel,

I presume you mean the Mesh Collider has no mesh, but the object does. In that case drag the Mesh object from the Project into the Mesh collider’s Mesh property. You can also hit the little target to the right of that property field to bring up a list to select from.

The object doesn't either.