|
According to the docs renderer.isVisible becomes true if the objects renderer is visible by any camera. How do I make it only true if visible by a specific camera?
(comments are locked)
|
|
Okay well it actually 'just works' as long as the cameras are set to render different layers. Basically 'isVisible' already takes into account the object culling mask..which I didnt realise. It's more than that. "Visibility" just means whether it gets sent to the GPU to be rendered. It may then be occluded by objects that are closer to the camera. http://forum.unity3d.com/threads/34225-Are-OnBecameVisible-and-OnBecameInvisible-named-poorly?p=222221
Oct 07 '10 at 02:19 PM
Jessy
Yeah I see. I'll need to write something to make sure the object is also facing the camera and not hidden by other objects as well as'being rendered by the camera/sent to GPU' :)
Oct 08 '10 at 11:42 AM
Grimmy
Also be aware that this isVisible is true if the editor camera can see that object. This is a pain when you want to use this variable for game logic like an enemy not shooting at the player unless they are on screen.
Jul 19 '11 at 03:34 AM
Antony Blackett
(comments are locked)
|
