When I am making a blueprint class based on Pawn Base, I don’t have a CapsuleComp.
I am having this
Instead of this
Here are my .h and .cpp files:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "PawnBase.generated.h"
class UCapsuleComponent;
UCLASS()
class TOONTANKS_API APawnBase : public APawn
{
GENERATED_BODY()
private:
UPROPERTY()
UCapsuleComponent* CapsuleComp;
UPROPERTY()
UStaticMeshComponent* BaseMesh;
UPROPERTY()
UStaticMeshComponent* TurretMesh;
UPROPERTY()
USceneComponent* ProjectileSpawnPoint;
public:
// Sets default values for this pawn's properties
APawnBase();
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
};
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "PawnBase.generated.h"
class UCapsuleComponent;
UCLASS()
class TOONTANKS_API APawnBase : public APawn
{
GENERATED_BODY()
private:
UPROPERTY()
UCapsuleComponent* CapsuleComp;
UPROPERTY()
UStaticMeshComponent* BaseMesh;
UPROPERTY()
UStaticMeshComponent* TurretMesh;
UPROPERTY()
USceneComponent* ProjectileSpawnPoint;
public:
// Sets default values for this pawn's properties
APawnBase();
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
};