Photo Mode (Experimental)
Last updated
Last updated
Modern 3A RPG games usually allow players to take photos during gameplay. A typical example is Ghost of Tsushima, which offers lots of professional camera parameters and screen effects for players to capture the most thrilling combat moment and the most beautiful landscape view.
This plugin provides a similar Photo Mode, with basic tunable camera parameters, screen and post-process effects. It's very easy to use and supports customization, enabling you to seamlessly take high-quality runtime screenshots.
Note: this feature is now experiemental. Do not heavily use it. You can reference how the photo mode works (through code and widgets) and create your own photo mode camera.
Settings up the photo mode is quite simple. Follow the steps below:
Ensure in your player controller, the bShouldPerformFullTickWhenPaused
parameter is on.
Create a new PhotoCamera.
In your newly created photo camera, implement the OnPhotoTaken
event. This function is called when you press the photo-taking button. The input parameter the current photo mode widget.
Here we play the animation when a photo is successfully taken. You can do any other work you want.
In your photo mode camera, go to Class Defaults
and find the Photo Mode
section. There are some parameters you should fill in to ensure the photo mode camra works correctly.
Photo Mode Mapping Context
Input mapping context for this photo camera.
Photo Mode Action
Input action for switching on/off photo mode. Make sure this action is added to current input mapping context.
Photo Mode Move Action
Input action controlling movement of photo mode camera. Make sure this action is added to current input mapping context
Photo Mode Rotate Action
Input action controlling rotation of photo mode camera. Make sure this action is added to current input mapping context.
Photo Mode Shot Action
Input action for taking a screenshot. Make sure this action is added to current input mapping context.
Move Speed Multiplier
Camera move speed multiplier, controls how fast photo camera moves.
Photo Mode Max Radius
Photo mode max radius when camera moves.
Pivot Position
Read-only. This is the position when you enter the photo mode. If the follow target is valid, it will be the follow target's position (for example when you are using a third person camera), otherwise it will be the gameply camera's position at the last frame.
Controlled Pawn
Read-only. This is pawn that is controlled by you during gameply.
It's highly recommended to create a new Input Mapping Context
and new Input Actions for the photo mode different from those for the player character and use them as the parameter values. For example, you can do add prefix PhotoMode
like this:
Once you create the input mapping context and these input actions, don't forget to fill them in the parameters in your photo mode camera.
Go to your PlayerCameraManager (should inherit from EPlayerCameraManager
), find the PhotoMode
section and fill in the parameters as required.
Photo Mode Camera
The photo mode camera class. Should inherit from EPhotoCamera
.
Photo Mode Widget
Photo mode widget UI class. You can use UW_PhotoMode
.
Unpausable Objects
Actor types that are not paused in photo mode. Currently not working for Niagara particles.
The PhotoModeCamera
parameter is the exact class that will be spawned when you enter the photo mode. It must inherit from the EPhotoCamera
class. In this class, you can implement various events that will be invoked at different phases of taking photos, e.g., when the photo mode widget is created, when some parameters are changed, when photo is taken, and when quitting photo mode.
The PhotoModeWidget
parameter is the user widget that'll be created and displayed when you enter photo mode. This plugin offers an initial user widget named UW_PhotoMode
, but it's highly recommended to duplicate and customize it as you need because it's not that aesthetic.
In your character's blueprint, call the Switch Photo Mode
blueprint node with the Photo Mode Action
you set up above (you should also add this action to the character's input mapping context).
Play the game and press the button of Photo Mode Action
. Have fun with it!
If you encounter blurry viewport when moving the photo camera, go to Edit->Project Settings, and turn off the default Motion Blur option.
By default, the photo mode camera's collision type is set to WorldDynamic
. You can change it in its root component (the sphere collision component).
Solve the blurry issue when in photo mode.
(Current solution: use World->bIsCameraMoveableWhenPaused = true, but is it reliable?)
Add photo gallery panel.
Automatically change the button icons according to the current device and the parameterized actions.
Add more features to the photo mode widget and sub-widgets.