Proper Environment Collision Model Creation?

Hello all!

I am trying to find some information on how to create an efficient and proper environment collision model…

What is the best way to create one? Is it to create primitive based geometry in your 3D package(all boxes, low poly) that covers the environment model? export it as an FBX, and then set it as the mesh in the Mesh Collider?

I’m just trying to figure out a inexpensive way to have an environment collider without resorting to the default ‘Mesh Collider’ setting that uses the high poly model.

Also, are there any issues,tips or notes that go with making a custom collision model in Unity?

I have tried searching for this on other posts, but they are mostly about object/prop based collisions.

Any comments and suggestions would be greatly appreciated.

Thanks in advance!

Although I haven’t tested it, if you have a decently complex set of geometry for the environment that you’ve created in some 3d creation software, it would probably be easiest to do what you already suggested. Make a very basic collision mesh in the same 3d software. When you bring in both geometries (the collision mesh and the detailed mesh), they will be relatively in the same position. You could disable the mesh rendering in the collision mesh and add a mesh collider as well, while keeping the detailed geometry as just visuals. I know mesh colliders aren’t the best thing for performance, but with simple geometry I don’t think it should be an sisue.

If your environment is more than a room with a box, its probably faster to make collision geometry outside of unity than in it.

thank you for the very quick reply!

I see what you mean now. Now that raises other questions about creating collision geometry…

My environment is a living room setting. with a flight of stairs (which the player can go up), couch and shelves. Now this simplified collision model that would go along with this…would it be comprised of boxes only? or can i include other primitives in the creation of this collision model such as cylinders?

For floors and walls. Is a large plane sufficient? Or does it have to be a volume (box). Lastly, can collision model parts intersect?

I know that’s a lot, but i think it covers the basics…

Once again thank you for any tips and comments!!

A cylinder is just a series of planes. Using a cylinder, or any other shape, if its necessary should be fine as long as you don’t make it overly complex. If you have… for instance a pillar in your room, making a cylinder with 8 sides is probably sufficient to get decent collision, while making a cylinder with 30 sides is overkill. Im also assuming the stairs will be a slope and not a series of boxes, which isn’t exactly realistic but it should probably suit your needs.

You can make a room out of 4 planes or you can take a 3d cube and position/scale it however you want. It doesn’t really matter, as long as the face normals all point in the correct direction. If you make a cube, for instance, the normals by default point outward. Placing a character inside a standard cube won’t work because he’ll fall to the bottom and fall through. Setting normals to face inward will hold the character in place.

And I don’t think collision meshs intersecting cause any problems.