Good evening, everybody! I have encountered a problem about [link text][1]. At the setp1 of section 2, I was asked to create a c++ class derived from the “Character”, and convert it to a blueprint, and assign it to the “Default Pawn Object” which can be found in “Project Settings”. I finished. But for the life of me, I found the output message I had written in the “BeginPlay()” had given out entrily! Because the “BeginPlay()” was not fired. It took me almost 3 hours… Up until now, I still have no solution for it… Is there anything I missed…? Could anyone help me?
#include "GameFramework/Character.h"
#include "FPSCharacter.generated.h"
UCLASS()
class FPSGAME_API AFPSCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AFPSCharacter();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
};
AFPSCharacter::AFPSCharacter()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AFPSCharacter::BeginPlay()
{
Super::BeginPlay();
if (GEngine)
{
GEngine ->AddOnScreenDebugMessage(-1, 5, FColor::Yellow, TEXT("Good, I'm character!"));
}
}
// Called every frame
void AFPSCharacter::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
}
// Called to bind functionality to input
void AFPSCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}