I have the following base class:
TOPPlayer.h
UCLASS()
class ATOPPlayer : public ACharacter
{
GENERATED_BODY()
public:
ATOPPlayer();
virtual void Tick(float DeltaSeconds) override;
};
TOPPlayer.cpp
ATOPPlayer::ATOPPlayer()
{
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true;
PrimaryActorTick.bAllowTickOnDedicatedServer = true;
}
void ATOPPlayer::Tick(float DeltaTime)
{
if (GEngine) {
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Yellow, "Ticking (Base)!");
}
Super::Tick(DeltaTime);
}
... And the following subclass:
TOPAvatarPlayer.h
UCLASS()
class ATOPAvatarPlayer : public ATOPPlayer
{
GENERATED_BODY()
public:
ATOPAvatarPlayer();
virtual void Tick(float DeltaSeconds) override;
};
TOPAvatarPlayer.cpp
ATOPAvatarPlayer::ATOPAvatarPlayer()
{
//PrimaryActorTick.Target = this;
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true;
PrimaryActorTick.bAllowTickOnDedicatedServer = true;
//Super::PrimaryActorTick.AddPrerequisite(this, PrimaryActorTick);
}
void ATOPAvatarPlayer::Tick(float DeltaTime)
{
if (GEngine) {
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Yellow, "Ticking (Avatar)!");
}
Super::Tick(DeltaTime);
}
My project uses two maps + two game modes. A main menu map set to use a "main menu" game mode, and a single-player map with an override set in the world settings to use a "single-player" game mode. The main menu game mode uses the `ATOPPlayer` pawn class, while the single-player mode uses the `ATOPAvatarPlayer` pawn class...
When the “main menu” map loads, I successfully see the words “Ticking (Base)!” appear in yellow… but as soon as I click the start button, the “single-player” map gets loaded, but I don’t see “Ticking (Avatar)!” OR “Ticking (Base)!” appear on the screen at all. I’ve tried everything I could find via google, yet to no avail.
Anyone have any idea what could cause this to occur, and what I can do to fix it?