# Photo Mode (Experimental)

## Introduction

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.

<figure><img src="/files/NSIjtefKAwztE62IELzL" alt=""><figcaption></figcaption></figure>

## Setup

Settings up the photo mode is quite simple. Follow the steps below:

1. Ensure in your player controller, the `bShouldPerformFullTickWhenPaused` parameter is on.

<figure><img src="/files/m7uWvl6Jy0cK44mHxMtr" alt=""><figcaption></figcaption></figure>

2. Create a new [PhotoCamera](/manuals-of-ccs/camera-components/miscellaneous/photo-camera.md).

<figure><img src="/files/RXOJ5OAIfblHd8JYgCLb" alt=""><figcaption></figcaption></figure>

3. 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.

<figure><img src="/files/C6exqAD5tWkuLqSVLb4W" alt=""><figcaption></figcaption></figure>

Here we play the animation when a photo is successfully taken. You can do any other work you want.

<figure><img src="/files/hur775nFu5tKvz21yimh" alt=""><figcaption></figcaption></figure>

4. 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.

<figure><img src="/files/hpVrjrbMA1CItN0DdodI" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="191.33333333333331">Parameter</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>Photo Mode Mapping Context</td><td>Input mapping context for this photo camera.</td><td>DampParams</td></tr><tr><td>Photo Mode Action</td><td>Input action for switching on/off photo mode. Make sure this action is added to current input mapping context.</td><td>DeltaSeconds</td></tr><tr><td>Photo Mode Move Action</td><td>Input action controlling movement of photo mode camera. Make sure this action is added to current input mapping context</td><td>Input</td></tr><tr><td>Photo Mode Rotate Action</td><td>Input action controlling rotation of photo mode camera. Make sure this action is added to current input mapping context.</td><td>DampTime</td></tr><tr><td>Photo Mode Shot Action</td><td>Input action for taking a screenshot. Make sure this action is added to current input mapping context.</td><td></td></tr><tr><td>Move Speed Multiplier</td><td>Camera move speed multiplier, controls how fast photo camera moves.</td><td>Output</td></tr><tr><td>Photo Mode Max Radius</td><td>Photo mode max radius when camera moves.</td><td></td></tr><tr><td>Pivot Position</td><td>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.</td><td></td></tr><tr><td>Controlled Pawn</td><td>Read-only. This is pawn that is controlled by you during gameply. </td><td></td></tr></tbody></table>

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:

<figure><img src="/files/6RaMtuz2m7ugeU0FSku9" alt=""><figcaption></figcaption></figure>

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.

5. Go to your PlayerCameraManager (should inherit from `EPlayerCameraManager`), find the `PhotoMode` section and fill in the parameters as required.

<figure><img src="/files/5i6MiyHlnVTcxV5ntctn" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="159.33333333333331">Parameter</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>Photo Mode Camera</td><td>The photo mode camera class. Should inherit from <code>EPhotoCamera</code>.</td><td></td></tr><tr><td>Photo Mode Widget</td><td>Photo mode widget UI class. You can use <code>UW_PhotoMode</code>.</td><td>DampParams</td></tr><tr><td>Unpausable Objects</td><td>Actor types that are not paused in photo mode. Currently not working for Niagara particles.</td><td></td></tr></tbody></table>

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.&#x20;

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.&#x20;

6. 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**).<br>

   <figure><img src="/files/TP3XWe9jElp9sb58IUcp" alt=""><figcaption></figcaption></figure>

   <figure><img src="/files/BuyHIpDdd0yLSmUYzBHM" alt=""><figcaption></figcaption></figure>
7. Play the game and press the button of  `Photo Mode Action`. Have fun with it!

<figure><img src="/files/jGojbqUIiXzXZsYEOYEL" alt=""><figcaption></figcaption></figure>

## **Tips**

1. If you encounter blurry viewport when moving the photo camera, go to Edit->Project Settings, and turn off the default Motion Blur option.
2. 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).

<figure><img src="/files/koYTxgArL68Z67qc9K9k" alt=""><figcaption></figcaption></figure>

## **TODOs**

1. Solve the blurry issue when in photo mode.&#x20;

(Current solution: use World->bIsCameraMoveableWhenPaused = true, but is it reliable?)

1. Add photo gallery panel.
2. Automatically change the button icons according to the current device and the parameterized actions.
3. Add more features to the photo mode widget and sub-widgets.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sulleyyys-organization.gitbook.io/manuals-of-ccs/basic-uses/photo-mode-experimental.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
