Custom GameState class does not tick

NightmareGames
Sat, 29 Jul 2023 21:22:22 +0000
C++

I have a GameState class which inherits from AGameStateBase. The BeginPlay() method fires correctly, but no breakpoints or functionality are hit in the Tick() function.

#include "CustomGameState.h"

void ACustomGameState::BeginPlay()
{
	testInt += 1;
}

void ACustomGameState::Tick(float DeltaTime)
{
	testInt += 1;
}

The test integer starts at 0 and goes to 1, but never gets higher than that.

I’m setting the GameState in the GameMode’s constructor like so:
GameStateClass = ACustomGameState::StaticClass();

The inheritance ladder looks like this:
ACustomGameState : AGameStateBase : AInfo : AActor

The Tick function I’m overriding actually comes from AActor. Is there something extra I need to do either in the editor or in C++ to get that actor to start ticking?

9 posts - 5 participants