APawn
#include "GameFramework/Pawn.h"
Access: public
Specifiers: UCLASS
Description
APawn is the base class for all actors that can be possessed and controlled by a PlayerController or an AIController. Pawns receive input and can be moved through a MovementComponent.
Caveats & Gotchas
- • Pawns require a Controller to receive input. Unpossessed pawns do not process player input.
- • For humanoid characters with walking/running/jumping, prefer ACharacter which extends APawn with a CharacterMovementComponent.
- • Possession can be replicated in multiplayer but the logic must be server-authoritative.
Signature
class APawn : public AActor Example
Minimal pawn with input C++
void AMyPawn::SetupPlayerInputComponent(UInputComponent* InputComp)
{
Super::SetupPlayerInputComponent(InputComp);
InputComp->BindAxis("MoveForward", this, &AMyPawn::MoveForward);
}
void AMyPawn::MoveForward(float Value)
{
if (Value != 0.f && Controller)
{
AddMovementInput(GetActorForwardVector(), Value);
}
} Functions (105)
Lifecycle 14 Transform 3 Components 1 Collision 2 Damage 2 Input 17 Networking 17 Rendering 2 Navigation 9 Utility 11 Camera 6 Controller 11 Movement 8 Physics 1 Possession 1
Lifecycle 14 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::BeginPlay |
| public | function | APawn::EndPlay |
| public | function | APawn::Restart |
| public | function | APawn::Destroyed |
| public | function | APawn::OutsideWorldBounds |
| public | function | APawn::PawnClientRestart |
| public | function | APawn::PostInitializeComponents |
| public | function | APawn::ReceiveRestarted |
| public | function | APawn::Reset |
| public | function | APawn::SetPlayerDefaults |
| public | function | APawn::DispatchRestart |
| public | function | APawn::NotifyRestarted |
| public | function | APawn::PostRegisterAllComponents |
| public | function | APawn::PreInitializeComponents |
Transform 3 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::GetControlRotation |
| public | function | APawn::FaceRotation |
| public | function | APawn::RecalculateBaseEyeHeight |
Components 1 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::GetPawnNoiseEmitterComponent |
Collision 2 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::MoveIgnoreActorAdd |
| public | function | APawn::MoveIgnoreActorRemove |
Damage 2 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::TakeDamage |
| public | function | APawn::ShouldTakeDamage |
Input 17 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::AddControllerPitchInput |
| public | function | APawn::AddControllerRollInput |
| public | function | APawn::AddControllerYawInput |
| public | function | APawn::AddMovementInput |
| public | function | APawn::DisableInput |
| public | function | APawn::EnableInput |
| public | function | APawn::ConsumeMovementInputVector |
| public | function | APawn::GetLastMovementInputVector |
| public | function | APawn::GetPendingMovementInputVector |
| public | function | APawn::InputEnabled |
| public | function | APawn::IsMoveInputIgnored |
| public | function | APawn::PawnStartFire |
| public | function | APawn::GetOverrideInputComponentClass |
| public | function | APawn::Internal_AddMovementInput |
| public | function | APawn::Internal_ConsumeMovementInputVector |
| public | function | APawn::Internal_GetLastMovementInputVector |
| public | function | APawn::Internal_GetPendingMovementInputVector |
Networking 17 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::GetLifetimeReplicatedProps |
| public | function | APawn::GetNetConnection |
| public | function | APawn::GetNetOwner |
| public | function | APawn::GetNetOwningPlayer |
| public | function | APawn::GetNetOwningPlayerAnyRole |
| public | function | APawn::GetPlayerState |
| public | function | APawn::GetPlayerStateChecked |
| public | function | APawn::GetPlayerStateObjPtr |
| public | function | APawn::GetRemoteViewPitch |
| public | function | APawn::IsNetRelevantFor |
| public | function | APawn::OnRep_Controller |
| public | function | APawn::OnRep_PlayerState |
| public | function | APawn::PostNetReceiveLocationAndRotation |
| public | function | APawn::PostNetReceiveVelocity |
| public | function | APawn::PreReplication |
| public | function | APawn::SetPlayerState |
| public | function | APawn::SetRemoteViewPitch |
Rendering 2 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::BecomeViewTarget |
| public | function | APawn::EndViewTarget |
Utility 11 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::GetController |
| public | function | APawn::IsControlled deprecated |
| public | function | APawn::IsPawnControlled |
| public | function | APawn::GetDefaultHalfHeight |
| public | function | APawn::GetHumanReadableName |
| public | function | APawn::GetLocalViewingPlayerController |
| public | function | APawn::IsLocallyViewed |
| public | function | APawn::SetController |
| public | function | APawn::TurnOff |
| public | function | APawn::DisplayDebug |
| public | function | APawn::ShouldTickIfViewportsOnly |
Camera 6 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::GetBaseAimRotation |
| public | function | APawn::GetPawnViewLocation |
| public | function | APawn::GetViewRotation |
| public | function | APawn::GetActorEyesViewPoint |
| public | function | APawn::InFreeCam |
| public | function | APawn::IsLocalPlayerControllerViewingAPawn |
Controller 11 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::IsBotControlled |
| public | function | APawn::IsLocallyControlled |
| public | function | APawn::IsPlayerControlled |
| public | function | APawn::PossessedBy |
| public | function | APawn::ReceivePossessed |
| public | function | APawn::ReceiveUnpossessed |
| public | function | APawn::UnPossessed |
| public | function | APawn::GetPlatformUserId |
| public | function | APawn::ReceiveCon trollerChanged |
| public | function | APawn::SpawnDefaultController |
| public | function | APawn::NotifyControllerChanged |
Movement 8 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::GetVelocity |
| public | function | APawn::CanBeBaseForCharacter |
| public | function | APawn::GetMovementBase |
| public | function | APawn::GetMovementBaseActor |
| public | function | APawn::GetPhysicsVolume |
| public | function | APawn::IsBasedOnActor |
| public | function | APawn::TeleportSucceeded |
| public | function | APawn::GetGravityDirection |
Physics 1 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::GetGravityTransform |
Possession 1 ▼
| Access | Type | Name |
|---|---|---|
| public | function | APawn::DetachFromControllerPendingDestroy |
Properties
| Access | Type | Name |
|---|---|---|
| public | property | APawn::AIControllerClass |
| public | property | APawn::AutoPossessAI |
| public | property | APawn::AutoPossessPlayer |
| public | property | APawn::BaseEyeHeight |
| public | property | APawn::Controller |
| public | property | APawn::LastHitBy |
| public | property | APawn::PreviousController |
| public | property | APawn::ReceiveControllerChangedDelegate |
| public | property | APawn::ReceiveRestartedDelegate |
See Also
Tags
Version History
Introduced in: 1.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?