So in my 3d game I need some flat invisible walls with no texturing but a collider, and also some flat objects that I am putting on top of stuff without colliders. (Think like a poster on a wall, or a path on a ground that doesn’t need a collider, but is just for show.)
So I have been wondering what is the most efficient way of doing this?
The two ways I have been doing it is with Planes for the posters, etc. and then flattened cubes for the invisible walls. (with their mesh render off) I could mix or swap these but idk which works best. I would think the planes cause they are flat, but it looks like their mesh is complex. While the cube is still “3d” its mesh looks rather simple.
Any ideas on which is better? Or any other ways of doing this?
I would suggest creating a simple 4-vertex plane in your 3d modelling applikcation and import it into Unity, and use the mesh as a MeshCollider for the wall colliders. This would be the most efficient way because you only have as many vertices as you need. Posters can also be done with the imported plane, this time of course as a proper gameobject that has a MeshRenderer and Material of the poster art applied to it.
Using a plane as a collider is maybe not the best idea, it can be quite easy to pass through a mesh collider attatched to a plane. You are better off using a box collider with some depth to it. For adding posters, paths etc look at the available Decal Systems on the asset store, they do exactly what you need and will avoid the Z fighting issues that you will probably get from doing it Cherno’s way.