So I need to render what’s on screen into a render texture. Before using cinemachine, this worked fine. But now, when I render the current camera into a render texture by setting the target texture of the current camera and using Camera.Render(), the wrong camera is rendered into the render texture.
Any idea what might be going wrong here?
Heyyoo
,
A VirtualCamera represents a position, rotation, lens settings… but what you see in the game view is done by the Camera component. Cinemachine places your Camera transform in the scene it does not do any rendering.
Based on what you said assigning a render texture to a Camera prevents it from rendering in the game view. If you don’t have any other camera with the tag MainCamera it randomly takes a camera in your scene (I think it’s the next one in the hierarchy but not 100% sure). Maybe that’s your issue?
If you give us a little more informations about your setup we could give more insight of what’s wrong. A screen shot of the hierarchy and inspector of your 2 camera would help. Maybe also any custom scripts calling Camera.Render() could be useful to understand what is going on.
Hope this helps. If not let us know with the info we are missing
.
1 Like