Well as the title says I imported a .fbx file into my unity project but when i go and hit play i can walk through it. Does anybody know how to fix this?
3D models imported in general within Unity, don’t have collision. You imported the raw 3d model with textures and other things, but Unity doesn’t know if this 3d model has any collision.
You have 2 options:
- on import settings check, Generate Colliders, and your model has collision as precise as the model itself
- click your 3d model in the scene and go to menu: Component → Physics → Mesh collider. When this component is attached to your 3d model, drag and drop a custom mesh in there that acts like a collision. This can be an even lower resolution model then the game model itself. Just for collision.
- create a gameobject Cube, which has already a box collider, and duplicate and place them the way you want your collision. Afther that, select all cubes and turn off the Render Component, this way they’re only used for collision without rendering anything visible.
Now, option 1 needs a lot of generating if you have a huge 3d model. so splitting it up, makes it easier. Some people model a whole 3d scene as 1 3d model and generate colliders. This is not so handy =)
Option 2 gives more control on your collision, but still needs a custom mesh to generate colliders from and is still heavier on realtime collision than a simple box, but easier then precise generated colliders from import settings.
Option 3 needs more time to create your collision for your model. However placing cubes takes time, but afther that you have a very simple collision geometry and easy on calculations for mobile or web.
Good luck =)
Thanks a lot ![]()