Switching Game States with Enumerations in Unreal Engine

- by

Enums are a great way to create state lists with memorable names. Rather than having to remember numbers, we can create Enums and switch depending on phrases. This can be handy for game state switching among other things.

We can create Enums by from the Content Browser under Blueprints.

This brings up an empty list we can populate with values on the left and optional descriptions on the right.

We can now set these Enums either directly, from a variable of type “whatever we’ve called our Enum” (in my case, Session State).

Likewise we can query Enums and even execute code depending on their value. Consider this logic in our Game Mode, which will implement different behaviour in response to Enum changes:

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