How to test which Game Mode is used at runtime in Unreal Engine

- by

For debugging we sometimes need to know what class is being used, for example what Game Mode might be used. There’s no easy way I know of that can tell us the exact file name, but we can do the next best thing and test which class is used. Here’s an example:

This code hooked up in the Player Controller would return a true/false while checking if the current game mode is a particular class and react accordingly.



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment