APawn::GetBaseAimRotation
#include "GameFramework/Pawn.h"
Access: public
Specifiers: virtualUFUNCTIONBlueprintCallableconst
Description
Returns the aim rotation for the pawn. For player-controlled pawns this is the camera rotation; for AI-controlled pawns this is the pawn's own rotation. Used as the base rotation for animation blending and weapon spread.
Caveats & Gotchas
- • The split between player (uses controller rotation) and AI (uses actor rotation) means the same function returns meaningfully different data depending on controller type — be explicit about which you need if mixing controller types in a game mode.
- • On non-locally-controlled pawns in a multiplayer game, the pitch portion of the returned rotation is reconstructed from the compressed RemoteViewPitch16 field, so it has limited precision (~0.0055 degree steps).
Signature
virtual FRotator GetBaseAimRotation() const Return Type
FRotator Examples
Sync actor body rotation to aim direction each tick
Blueprint
Drive animation aim offset from base aim rotation C++
FRotator AimRot = Pawn->GetBaseAimRotation();
FRotator ActorRot = Pawn->GetActorRotation();
FRotator Delta = (AimRot - ActorRot).GetNormalized();
// Delta.Pitch drives the vertical aim offset blend space Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?