RealDocs

APawn::AddControllerRollInput

function Engine Blueprint Since 4.0
#include "GameFramework/Pawn.h"
Access: public Specifiers: virtualUFUNCTIONBlueprintCallable

Description

Adds roll rotation to the owning PlayerController's ControlRotation. Used for vehicles, aircraft, or other pawns that require barrel-roll or banking input.

Caveats & Gotchas

  • Roll is not applied by default to standard humanoid characters (ACharacter ignores controller roll for the capsule). You must explicitly use the controller's roll value in your rotation logic or camera setup.
  • Like pitch and yaw inputs, this only affects local PlayerControllers and is a no-op for AI or remote controllers.

Signature

virtual void AddControllerRollInput(float Val);

Parameters

Name Type Description Default
Val float Amount to add to roll. Multiplied by the PlayerController's InputRollScale before application.

Return Type

void

Examples

Apply roll input and sync actor rotation to control rotation each tick Blueprint
InputAxis Roll Axis Value Roll Sensitivity Roll Sensitivity Roll Sensitivity Multiply (Float) A B Return Value Return Value Add Controller Roll Input Target is Pawn Target Val Event Tick Delta Seconds Delta Seconds Get Control Rotation Return Value Set Actor Rotation Target is Actor Target New Rotation Sweep false
Edit Blueprint graph Apply roll input and sync actor rotation to control rotation each tick
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Roll a spaceship pawn C++
void ASpaceshipPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
	Super::SetupPlayerInputComponent(PlayerInputComponent);
	PlayerInputComponent->BindAxis("Roll", this, &ASpaceshipPawn::AddControllerRollInput);
}

void ASpaceshipPawn::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
	// Apply the controller's full rotation including roll
	SetActorRotation(GetControlRotation());
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.