- Home /
Hide gameObjects which are blocking camera's view
Hello, I've been trying to hide an object which is blocking my camera's field of view, but I cannot come up with a suitable solution In my scene, I am playing with rotation and it can happen, that boxes are blocking my view - as in the picture below.
I would like to have a solution, which would look like following picture - where boxes are not blocking my view. Of course if I rotate 180 degrees, I would see them.
Do you have any idea, how to solve it? Thanks
Answer by shieldgenerator7 · Feb 05, 2018 at 06:13 PM
Increase the camera's nearClipPlane
. I believe this works in 3D too, but I know that at least in 2D increasing the main camera's nearClipPlane
will make things that are too close to the camera invisible.
@shieldgenerator7 nearClipPlane would work, but I would have to adjust it some how dynamically. The reason is, that for different rotation I do not have good results. I guess if I haven't had my camera rotated along x axis, that result would be perfect. Unfortunately I need x axis rotation as well.