How do i change a SceneCapture2D's Texture Target at runtime?

I am trying to simulate a security monitor where the player can get a feed from some cameras, and select which camera to watch

This is what i tried: i get all of my SecurityCamera actors from the world:

Then, when the player presses 1,2 or 3, it updates a variable and to change the Texture Target i do this stuff:

The problem is that this logic doesn’t work, where’s the mistake?

Thanks for the answers.

Hey Crax -

If I am understanding you correctly you want to have three camera (A,B,C) and one Monitor that the player can change between A,B,C by pressing 1,2,3. If that is the case, then you would not want to adjust the Render Target of the Camera but adjust which texture is shown on the monitor.

For the setup I would assign 3 Different Render Target Textures to your three cameras. I would then create a material with a Texture Sample Parameter plugged into emissive and assign the default camera view into the parameter. Next, Take the Material and create three Material Instances of that Material and name them MI_CameraA, MI_CameraB, MI_CameraC. I would place my monitor in a blueprint and in the Construction Script, I would create a Dynamic Material Instance based on one of the MI_Camera material instances and assign it to my monitor. In the Event Graph I would on each of the number press events reassign the Dynamic Material Instance to the correct MI_Camera materials. So, on Key Press “1” Create a Dynamic Material Instance based on MI_CameraA and assign it to the monitor, on Key Pressed “2” Create a Dynamic Material Instance based on MI_CameraB and assign it to the monitor, and finally on Key Pressed “3” Create a Dynamic Material Instance based on MI_CameraC and assign it to the monitor.

Thank You

Eric Ketchum

Yeah, in the end i kinda copied the camera switch from the Blueprint Office example.
I used the not-working method because it worked on Unity.

If you set it up like that without additionally disabling/enbaling the cameras theyre gonna update when not using + take up memory even after the cameras are disabled. I’d do three scene captures pointing at the same one texture which will be displayed on the screen. By default they overwrite the previous data of the texture on every capture so you can just disable 2 of the three cameras and the only thing that will appear on the texture is the one camera you didnt disable. I perosnally find this method more intuitive but you can use the first one as well, there’s not much of a difference if you do it right.