Global Variables for every Blueprint scripts?

Great!! now It works, but again…I always need an ‘object container’ for make it persistent, right?
In your example you are using gamemode to make the value persistent. So there is no a ‘pure global’ place to keep the value, right?

I wanted to use function libraries more often and reuse along my projects but I always end creating a custom UObject with the functions instead so I have a container for the persistent data like this:

the object:

Usage in any object (if I declare it and construct in gamemode all have access to it):

So I am concluding for now that there is no way a data can be stored GLOBALLY without a container.
I read somewhere using the_project_namename.h file to make global variables but I tried to create some variables there using UPROPERTY(BlueprintReadWrite) there and it compiles but cant access it from blueprints.

I really appreciate all the time you dedicated to this !!
Thanks!!!

Dany

1 Like