- Home /
Rendering part of a mesh on the camera
Hello,
I would like to ask if anyone knows how to make part of an object not render in the camera? Like for example, if I had a room, I would have an imaginary sphere surrounding part of the room, is there any way to just make the camera render that part of the room only, making the other parts that are not in the sphere invisible?
I've thought of using Physics.Overlapsphere, camera fov and clipping range, and also layers, but I'm not really sure how to only make unity render a part of the mesh.
Thanks in advance
Answer by KJIB · Feb 06, 2013 at 02:32 PM
If you know that you do not want to show an object then disable it. If necessary break a large object into more objects so that you can enable the part(s) in questions at will. If it's the other way around (i.e. show just a given item and nothing else) then you can always temporarily change the parent on the item you want to keep (put it in the root) and then turn off everything else.
You could, for example, parent the inside of a room to the root. Make everything else inactive. When you are finished put the interior of the room back in the hierarchy where it was and set things back to active.
Your answer
Follow this Question
Related Questions
Camera FOV in build with custom render pipeline in Unity 2019.3 1 Answer
Prevent inner edges from being at front 0 Answers
Unity cam problem 1 Answer