RealDocs

APawn::GetControlRotation

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

Description

Returns the rotation of this pawn's controller, which typically represents the player's look direction or the AI's facing direction. Returns FRotator::ZeroRotator if the pawn has no controller.

Caveats & Gotchas

  • For player characters, this is the camera/crosshair rotation — it often differs significantly from GetActorRotation(), especially in third-person games where the pawn body and the camera can face different directions.
  • Returns FRotator::ZeroRotator (not the pawn's actual rotation) when there is no controller, which can cause subtle aim bugs in offline or AI-controlled pawns that are temporarily unpossessed.
  • In multiplayer, the control rotation for remote players is reconstructed from the compressed RemoteViewPitch16 byte — pitch precision is limited to approximately 0.005 degrees steps.

Signature

FRotator GetControlRotation() const

Return Type

FRotator

Examples

Orient pawn to face controller look direction (yaw only) on BeginPlay Blueprint
Event BeginPlay Get Control Rotation Target is Pawn Target Return Value Break Rotator Rotation Roll Pitch Yaw Make Rotator Pitch 0.0 Yaw Roll 0.0 Return Value Return Value Set Actor Rotation Target is Actor Target New Rotation Teleport Physics Teleport Physics false false Return Value
Edit Blueprint graph Orient pawn to face controller look direction (yaw only) on BeginPlay
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Fire projectile along look direction C++
void AMyPawn::Fire()
{
	FRotator MuzzleRotation = GetControlRotation();
	FVector MuzzleLocation = GetMesh()->GetSocketLocation(TEXT("Muzzle"));
	FActorSpawnParameters Params;
	Params.Instigator = this;
	GetWorld()->SpawnActor<AMyProjectile>(MuzzleLocation, MuzzleRotation, Params);
}

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.