I’m working on a project where I need to run some code whenever the camera renders my GameObject, so I’m using “OnRenderObject()” for that.
While in scene view, the method works normally, and the code is executed.
When I run my game, the “OnRenderObject()” method just stops working.
Every help is welcome.
Thank you for your time.
I just found this documentation and it says that “OnRenderObject()” is not supported in HDRP (only in URP and Built-in as far as I can see)
https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@10.3/manual/Feature-Comparison.html
Does anyone know if there is a forecast to support this Hook in the future? (Maybe a link to some topic/blog where Unity refers to it, unfortunately I couldn’t find anything with the keywords I used)
Again, any help is welcome!
If you need to do some code when object is visible through camera - just check if object is inside camera frustum with GeometryUtility.CalculateFrustumPlanes and GeometryUtility.TestPlanesAABB
1 Like
I understand! Thanks for the help!