UCLASS()classTESTPROJECT01_API AMyPawn :public APawn
{
GENERATED_BODY()public:// Sets default values for this pawn's propertiesAMyPawn();protected:// Called when the game starts or when spawnedvirtualvoidBeginPlay()override;public:// Called every framevirtualvoidTick(float DeltaTime)override;// Called to bind functionality to inputvirtualvoidSetupPlayerInputComponent(classUInputComponent* PlayerInputComponent)override;UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category ="MySceneComponent")
USceneComponent* m_pRootScene;UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category ="MySceneComponent")
USpringArmComponent* m_pSpringArm;UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category ="MySceneComponent")
UCameraComponent* m_pCamera;};
1.2 初始化组件
AMyPawn::AMyPawn(){
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick =true;// createthis->m_pRootScene =CreateDef