# ODK Selfie Cam

Selfie Cam

![](https://33425813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbIBFTVTQoxu1YByrB4tU%2Fuploads%2FVP24pKEvRYnMoUgOO4gf%2F0.gif?alt=media)

The Selfie Cam example is made up of several modular pieces to showcase the various features required for the end-to-end flow.

At a high-level, the system is composed of the following key components and functions:

**BPC\_SelfieCamComponent**

A component attached to the **BP\_ODK\_PlayerCharacterBase**, responsible for toggling selfie camera mode. It spawns the **BP\_SelfieCameraActor**.

**BP\_SelfieCameraActor**

This actor contains a CineCamera component. Once spawned, it attaches to the player's hand socket and communicates its location to the Animation Blueprint via a Blueprint Interface. This enables the Animation Blueprint to sync the hand's location using an IK chain. The actor also manages the Camera UI and binds to its events.

**BPC\_HighResShot**

Another component on **BP\_ODK\_PlayerCharacterBase**, with a **Take Screenshot** event that allows specifying location, format, and resolution. It can display an optional preview widget, which is customizable and works with a Blueprint Interface for swapping. The component also includes the following Event Dispatchers: **OnHighResShotSaved**, **OnFlashShown**, **OnFlashClosed**, and **OnPreviewShown.**

**BPFL\_ScreenshotTools**

After a screenshot is saved, the image can be uploaded to the user collection using the **User Collection Upload Screenshot** function from the **BPFL\_ScreenshotTools** library.

### Using the Selfie Cam <a href="#id-3tcxig5qpz99" id="id-3tcxig5qpz99"></a>

<mark style="background-color:$danger;">**Important Note**</mark><mark style="background-color:$danger;">: The BP\_AttachmentManagerODK singleton must be defined in your level's world settings > Non Morpheus singletons section.</mark>\ <mark style="background-color:$danger;">The Koda Cam system relies on this manager to perform mesh attachments to both character and crowd actor instances. If the singleton is not present, attached meshes will fail to render, and the avatar selfie stick functionality (for short-arm configurations) will not execute correctly.</mark>

The Selfie Cam can be activated using the **IMC\_SelfieMode** Enhanced Input Mapping with the following actions:

**IA\_ScreenshotCamera\_Toggle** - Enable/Disable the Selfie Camera

**IA\_RotateCamera** - Rotate the camera when active

**IA\_ZoomCamera** - Changes to field of view to simulate camera zoom

**IA\_SelfieMode\_TakeSnapshot** - Save the image to disk

### Live Config <a href="#ac237jldyiug" id="ac237jldyiug"></a>

The selfie cam is capable of saving high resolution images to disk and uploading them. This could lead to several large files being uploaded by multiple users.\
To mitigate any risk, several Live Config values have been added:

**ODK.SelfieCam.Enabled** - Allows for disabling the activation of the Selfie Cam. If this is set to false, when a user presses the toggle shortcut, the BP\_SelfieCamActor will not be spawned.\
**ODK.Collections.AllowImageUpload** - Users will stil be able to use the Selfie Cam, but the Image Upload option will be disabled.
