How can I store variables in all levels?

I’m not sure, never used it, maybe you can make a Class that inherits from UGameInstance, then add some variables with static modifier. I don’t have any idea how to do it in blueprints, I use only C++.