- Home /
How not to render a specific object ?
HI, I've been wordering for quite a while now if there is a way to NOT render a given object/mesh renderer for a specific camera, without using layers ? I know there are different methods for tweaking the rendering in the Camera class but I don't know if ther is a clean way to do this.
Answer by hexagonius · Oct 17, 2019 at 08:41 AM
The only other method I know of is hooking into the Camera.onPreRender and Camera.onPostRender to toggle the renderer during rendering of the camera of your choice:
https://docs.unity3d.com/ScriptReference/Camera-onPreRender.html
Your answer
![](https://koobas.hobune.stream/wayback/20220612213518im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
occlusion culling conflict with shader,Occlusion culling conflict with shader 0 Answers
How Do I Not Render Objects That My Player Doesn't See 1 Answer
How do I make gameobject invisible (2D)? 1 Answer
Is particular object visible 1 Answer
Dynamically render/hide object individually for each camera in scene 0 Answers