UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DefaultPawn.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3//=============================================================================
4// DefaultPawns are simple pawns that can fly around the world.
5//
6//=============================================================================
7
8#pragma once
9
10#include "CoreMinimal.h"
12#include "GameFramework/Pawn.h"
13#include "DefaultPawn.generated.h"
14
15class UInputComponent;
17class USphereComponent;
18class UStaticMeshComponent;
19
24UCLASS(config=Game, Blueprintable, BlueprintType, MinimalAPI)
25class ADefaultPawn : public APawn
26{
28
29 // Begin Pawn overrides
30 ENGINE_API virtual UPawnMovementComponent* GetMovementComponent() const override;
31 ENGINE_API virtual void SetupPlayerInputComponent(UInputComponent* InInputComponent) override;
32 ENGINE_API virtual void UpdateNavigationRelevance() override;
33 // End Pawn overrides
34
40 UFUNCTION(BlueprintCallable, Category="Pawn")
41 ENGINE_API virtual void MoveForward(float Val);
42
48 UFUNCTION(BlueprintCallable, Category="Pawn")
49 ENGINE_API virtual void MoveRight(float Val);
50
56 UFUNCTION(BlueprintCallable, Category="Pawn")
57 ENGINE_API virtual void MoveUp_World(float Val);
58
63 UFUNCTION(BlueprintCallable, Category="Pawn")
64 ENGINE_API virtual void TurnAtRate(float Rate);
65
70 UFUNCTION(BlueprintCallable, Category="Pawn")
71 ENGINE_API virtual void LookUpAtRate(float Rate);
72
74 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Pawn")
75 float BaseTurnRate;
76
78 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Pawn")
79 float BaseLookUpRate;
80
81public:
84
85protected:
87 UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
89
90public:
92 static ENGINE_API FName CollisionComponentName;
93
96 UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
97 TObjectPtr<USphereComponent> CollisionComponent;
98public:
99
101 static ENGINE_API FName MeshComponentName;
102
103private:
105 UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
106 TObjectPtr<UStaticMeshComponent> MeshComponent;
107public:
108
110 UPROPERTY(Category=Pawn, EditAnywhere, BlueprintReadOnly)
111 uint32 bAddDefaultMovementBindings:1;
112
114 USphereComponent* GetCollisionComponent() const { return CollisionComponent; }
116 UStaticMeshComponent* GetMeshComponent() const { return MeshComponent; }
117};
118
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
return true
Definition ExternalRpcRegistry.cpp:601
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
float Val(const FString &Value)
Definition UnrealMath.cpp:3163
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition DefaultPawn.h:26
static ENGINE_API FName MovementComponentName
Definition DefaultPawn.h:83
UStaticMeshComponent * GetMeshComponent() const
Definition DefaultPawn.h:116
Definition NameTypes.h:617
Definition InputComponent.h:729
Definition PawnMovementComponent.h:43
Definition ObjectPtr.h:488