"Simple" mesh collider or bunch of box colliders?

I’m not sure how I should be approaching colliders for my prefabs here. I have a bunch of river bed prefabs that I place on my terrain (not to be confused with the Unity terrain). My objective is to allow the player to wander close to the riverbank, without falling in.

My current approach (see screenshot) is to have a truckload of game objects parented to the prefab, all marked static and all with box colliders. It works but seems awfully cumbersome? Would I be better off generating a simple mesh that follows the river bank and extends up the Y axis a few units? I would then attach that in script somehow when I generate the level (still looking to see how to do that).

1353039--66790--$colliders.png

I personally would stick to box colliders as much as possible for performance reasons, especially in environments. Mesh colliders will fit your terrain like a glove by creating alot more faces than box colliders, but its taxing on the cpu.

I agree, sticking to primitive colliders wherever possible is great.

PinMan, have you considered using bigger colliders going over the whole of the river? If they’re just to stop the player falling in then you can use layers so that other things don’t collide with them and they don’t mess with whatever else you may have going on. It’ll be far fewer colliders, so less work for you to set up.

@surreal4224 - thanks for the affirmation. Everything I read indicated that mesh colliders should be avoided in environments. I was unsure, because I thought a simple mesh collider of say 20 or 40 polys might be OK. Mind you, I’m typically using 8 of these prefabs in my level so it adds up.

@angrypenguin, yes. The corner prefab pieces are an L-shaped mesh so I had a ground-level collider for each “leg” of the L so my character didn’t fall through. I also had a 1 unit high collider extending up the Y axis to prevent the player from falling in the river. These did extend over the whole water area.

Mayhap I need to rework the geometry on these corner pieces a little and make them a bit more parallel, and just have say 4 colliders covering the river edges and the 2 at ground level.