Hi guys,
I just went to use the isVisible property of the renderer (Renderer.isVisible) and noticed that it no longer appears to exist? Compiler certainly isn’t recognizing it. (Using Unity 5.3)
Is this true? How else (other that using the Camera.WorldToViewPort function) could I determine if an object is being rendered within the viewport?
Thanks!
It still appears in the documentation, with no note that it’s been deprecated. This suggests that it’s a problem with the way you’re using it. Can you paste your code, and the actual error message received?
1 Like
You can use the dot product of the camera’s forward axis & the target transform’s direction relative of the camera in order to get an approx idea whether it’s visible or not. combine this with raycasting and you should be good.
Component.renderer is deprecated
use GetComponent().isVisible
1 Like
This is what the smart money says the problem is… 
1 Like
It’s not depreciated, it’s merely not cached any more, so you need to look renderer up yourself.
Excellent thanks guys!
It certainly was the Component.renderer which is deprecated. Retrieving the component itself still works though. Silly problem, but thanks!