Hi there! I am working on a task that involves adding an extra camera to the scene and rendering its view on a separate viewport, like in this PG -
The issue I face here is that the last camera in the scene.activeCameras array is always set to scene.activeCamera, where I expect to find my main camera. (In the PG, the console log shows the active camera set when a pointerDown is executed on the scene) This is causing a lot of miscalculations in other functionalities since the unintended camera is found in scene.activeCamera.
Is this behaviour intended, that the scene.activeCamera always refers to the last camera in scene.activeCameras?
I tried out the following -
→ Explicitly setting scene.activeCamera to the required camera does not work. (I have added this scenario to the scene.onPointerDown event in the PG).
→ I am hesitant to use scene.activeCameras[0] instead of scene.activeCamera since the codebase I am working on is quite large, and there are a lot of references to scene.activeCamera.
→ The order of activeCameras affect the order in which the viewports are rendered so I cannot add the new camera to the beginning of the activeCameras array.
Is this a bug? If not, is there an alternate solution I could try out?
Thank you! ![]()