- Home /
Is particular object visible
I try to check if a particular object is visible. I'm not looking for IsVisible or OnGetVisible or so. These just check if the object is rendered. And if it's behind a wall it's rendered too. I already asked this question and the best answer in my opinion was to render the world to a second camera. All in black except this one particular object in white. Then check if one or more pixels are white. If yes --> visible, else --> invisible
Does someone has an idea how to get this?
Answer by digiben · Feb 17, 2013 at 06:57 AM
Are you using the occlusion stuff in Unity? That will turn off objects when they aren't visible for you. Then you should be able to query from that.. like if they are behind a wall the occlusion will auto hide it. Or, you can build your own octree or BSP and do the frustum collision yourself? But shouldn't need to.