How can I access a custom GameMode?

Hi all,

I have a (hopefully quick) question regarding game modes in C++. I have a custom game mode that I’ve created in C++, and some other C++ modules I need to interact with data contained in that game mode. How can my C++ code access the current game mode?

I know that in Blueprint there’s a convenient GetGameMode node that does exactly this, but I’d like to know if there’s a similar function in C++ that I can call.

GetWorld()->GetAuthGameMode();

please try to google it first before posting new threads. Previous thread