Set Control Rotation on the new Gameplay Camera System

Hi, we were able to find a workaround for this by clearing the Input in the Boom Arm node and modifying the PlayerController Control Rotation directly.

The Offset node is :unamused_face:, especially the rotation offset, but anyway…


Let’s start with the Boom Arm. If you look at the OnRun function for the BoomArm in C++ (Unreal 5.5.4), you can see that it uses the Player ControlRotation if the input is not set, assuming the camera is attached to an actor that has a PlayerController, which in our case is the Player.

void FBoomArmCameraNodeEvaluator::OnRun(const FCameraNodeEvaluationParams& Params, FCameraNodeEvaluationResult& OutResult)
{
	FRotator3d BoomRotation = FRotator3d::ZeroRotator;
	if (InputSlotEvaluator)
	{
		InputSlotEvaluator->Run(Params, OutResult);
		const FVector2d YawPitch = InputSlotEvaluator->GetInputValue();
		BoomRotation = FRotator3d(YawPitch.Y, YawPitch.X, 0);
	}
	else if (APlayerController* PlayerController = GetPlayerController(Params.EvaluationContext))
	{
		const FRotator3d ControlRotation = PlayerController->GetControlRotation();
		BoomRotation = ControlRotation;
	}
//...
}

With this beautiful info, you can easily set the control rotation in the player following this video, for example: How to Make a Enemy Target Lock System in Unreal Engine 5


In the documentation, the Control Rotation was set directly in the Director for the Top-Down camera at the end.
Gameplay Camera System Quick Start | Unreal Engine 5.6 Documentation | Epic Developer Community

You can even take it a step further by utilizing Variable Tables.

First of all, we would create a variable table with a bool bTargetActive and a vector3d TargetLocation

Then we can add this in the director (ofc in a function to call after activating the rig we want the Lock Camera to activate)
Gameplay Camera - Controller Update - Director posted by anonymous | blueprintUE | PasteBin For Unreal Engine

The variable can be set by getting the variable table from the camera and setting a new variable.
Here in the BP_ThirdPersonCharacter, I am using a FlipFlop node to alternate between enabling and disabling each time the E key is pressed.


We can even take it a step further by adding this logic to a custom CameraNodeEvaluator blueprint. However, in Unreal 5.5.4, I wasnt able to fetch variables directly inside the node so its a probably a bug.

By having it a separate node, you can easily add it to custom differernt rigs without thinking about call the fuction in the director.

If you still insist to have it a separate node (with the variable retrieving issue), then you would need to cache the target location somewhere else in the player or an interface getter and use this instead in the CameraNodeEvaluator blueprint.

:warning: VERY IMPORTANT NOTE :warning::
The order of the nodes is important, setting the player control rotation has to be set BEFORE the boom arm.


More imporvement note is to LERP the control rotation using the Param.Delta in the Director or the CameraNodeEvaluator but I think you are good to go from here.
Hope its helpful! Good luck and thank you :folded_hands:

1 Like