Skip to content
Gallery
Documentation: Ultimate Gameplay Camera
Share
Explore
Camera Modifiers

icon picker
Focus Modifier

Focus.gif

Focus Camera

The Focus Camera Modifier allows you to center your camera on any position and/or actor in the game. This is useful for implementing systems like Hard-Lock (also known as Camera Lock-On), Aim Assist, or highlighting points of interest in the game such as loot, or conversations recipients.
Here are examples from AAA video games
EldenRing.gif
Source - Elden Ring
RDR2.gif
Source - Red Dead Redemption 2
DarkSouls.gif
Source - Dark Souls
UnchartedFocus.gif
Source - Uncharted: The Lost Legacy

Focus Modifier Setup Video

Focus Modifier Settings

There are a number of settings you can tweak for the focus modifier.
image.png
Enabled: Whether is enabled or not.
Interp Speed: How fast the camera keeps track of the focused location.
Rotation Offset: An offset in degrees applied on the pitch and yaw. This is useful if you want the focused location to always be on the left/right or looked down/up.
Focus.gif
Without Rotation Offset
Target perfectly centered
FocusWithOffset.gif
With Rotation Offset (Yaw=-20.0)
Target is offset to the right side
Ignore Camera Input: Whether the player’s input should be ignored when the focus is active or not. Disabling it will make the camera feel like a spring pulling back to the focus target.
FocusWithInput.gif
Focus Camera with input
Rotate Yaw Only: Whether we should rotatet only the yaw angle of the camera or the pitch as well. You can set this to true and combine it with the Rotation Offset if you want the cam to stay at a specific pitch.
Stop if Blocked LOS: Whether we should stop focusing if the line of sight to the target location is blocked.
Blocked LOS Time Threshold: How long should the Line Of Sight be blocked before we finally disabled the Focus.
Min Distance from Target: The minimum distance from the target. This is useful because being too close to the location will make the camera spin like crazy.
Max Distance from Target: This is useful in order to disable the focus camera if the target location gets too far.
Focus Target Method: This is a class you can create which will give us the location and the actor that the camera should focus.
You can set these settings either by calling SetCameraFocusSettings (among other functions) on BP_UGCCameraManager:
image.png
These are all functions you can use in the BP_UGCCameraManager.
Or you can set them through the UGCCameraDataAssets, and then calling SetCameraData on BP_UGCCameraManager (see ).
image.png
cancel
Never enable the Yaw Follow Modifier and/or Pitch Follow Modifier at the same time as the Focus Modifier.

Focus Modifier Target Method

In order to create a new target method, start by creating a new Blueprint Class, inheriting from UGC_IFocusTargetMethod
image.png
In your new blueprint, you can override the GetTargetLocation function ​
image.png
The function passes in some potentially useful information to you such as the owner actor, the owner’s location, the location of the camera and its rotation.
image.png
cancel
Always call the parent function in the GetTargetLocation!
image.png
Here you can use your components or calculations to provide the target location that you want the camera to focus on and potentially the actor that is being focused as well. The focused actor output is used to test for the line of sight. Now you can compile and save.
In order to use the new target method, you can either set it up in your UGC Camera data asset
image.png
image.png
Or you can call SetFocusTargetMethod by passing in the class of the blueprint you have just created ​
image.png

Focus Modifier Issue

FocusProblem.gif
The problem with the focus camera is that when you get too close to the location you are trying to look at, the camera starts spinning around trying to catch up but never being able to.
As a workaround, we have made it so that the position you are trying to focus will slightly get more offset forward when you get too close, that way the camera stays sane.
FocusProblemFix.gif
(Notice how the arrow on top of the target gets offset around)

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.