How to get in-game screenshots from specific cameras?

Hi, I’m trying to set up a ‘photo mode’ for the third-person template that will take a picture when the left button is clicked. I have it all set up, and the pictures save to the appropriate folder in the project files, however every picture is from the perspective of the editor, not from the camera attached to the player. Does anyone know how I can fix this?

Hi,

Click on the arrow below the Take High Res Screenshot node to show the rest on the inputs, you can then set your Camera Actor reference.

Hi, how do I get the Camera Actor Object Reference? I have my Camera Component Object Reference, but I’m not quite sure how to work around this as casting doesn’t work.


Thank you again!

You can get the camera reference directly if the camera was a level actor, so by adding a camera to the level, making sure it’s selected, then going to the Level Blueprint > right click anywhere in the graph > Create a Reference to CameraActor > connect to Take High Res Screenshot Camera variable.

For reference:

As for your scenario, you could attach the camera that you have added manually to your level to the Third Person camera of your character on BeginPlay, using Attach Component to Component function on the Level Blueprint BeginPlay event, then handle taking screenshots at the Level Blueprint, so by creating an event dispatcher (you could call it OnScreenshotCaptured) at your player blueprint which you should call when LMB is clicked, then on BeginPlay of the Level Blueprint, get a reference to your player character > Assign event OnScreenshotCaptured > connect the newly added event to TakeHighResScreenshot (which should have its Camera reference connected to the camera you manually placed in your level).

And of course make sure that any settings, like Field of View, are the same for both cameras.

So at your player character:
1- Create an Event Dispatcher called OnScreenshotCaptured.
2- Call this event dispatcher on Left Mouse Button.

And at the Level Blueprint:

1- Attach the camera you manually added to the level to your player’s camera by getting a reference to your player camera, a reference to the camera in level, then use Attach Component to Component function, connecting the player’s camera as the parent component.
2- From the player’s reference, call Assign OnScreenshotCaptured, which will add a custom event.
3- Call TakeHighResScreenshot from this custom event, and make sure the Level’s camera is connected to its Camera reference.