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.
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?
Thanks for the pointers. I can’t tell if bCanEverTick was true, but I’ve set it to true now. I’ve also added Super::BeginPlay, but there’s no change to the integer count.
I took another look at my game mode (which I’m not using for anything yet) and noticed it’s still only the constructor.
As a wild hunch, I added a BeginPlay method to see what would happen.
void ACustomGameMode::BeginPlay()
{
}
Even though it contains no code, adding that caused the game state to start ticking. I don’t have a good explanation for that, aside from a vague knowledge that those two classes are closely related.
Even weirder is that after removing ACustomGameMode::BeginPlay(), the GameState still ticks. I especially can’t explain that one.