Appropriate container for global variables

I need to have a variable available from any blueprint in my game. For example I need to turn on and off extended logging. When extended logging is on all blueprints must call additional PrintString commands.

What is an appropriate place for the storage of such variables?

I have read answers which suggest creating a special actor and access it by node “All Actors of Class”. But this solution looks like a workaround.

Also I know about Game Instance. It can be used as a container of variables available from all blueprints. Is it the only way to store global variables? Maybe there are other containers?

You can use static properties and methods in a UBlueprintFunctionLibrary class with C++.

If your project is Blueprint only, GameInstance blueprint is a good solution, since it is instantiated when the game executes and persists until the game is closed.

You can also create a Blueprint Funcion Library to store getter functions:

275134-b.png

And access it like this: