Game State Class unidentified when called from GameMode

Hi, I’m trying to set up the Game State and Game Mode on C++ but i’m having a problem.
he function “GetGameState” should work with PlatformerGameState. But it doesnt.
The error is “identifier PlatformerGameState is undefined”


Capture

What am I doing wrong?

First: The class is called APlatformerGameState, so that’s why it’s not finding a declaration for something named PlatformerGameState

Second: You should include the ...GameMode.h file first in your ...GameMode.cpp file – include the PlatformerGameState.h file after that. This is not the cause for the error above, but a general best practice to avoid surprise defined/undefined errors.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.