Creating objects accessable from everywhere

I am going to ask this question again.And I am quite disappointed that I have got no answer till now.This is kind of stuff which will help me to decide to stay with UnrealEngine or not.

In my project I have a lot of settings which are defined by user via GUI before the game start.I need all those settings to be accessible both in BluePrints and in my C++ codebase.In typical architecture design there would be a singleton objects which allows to any objects anywhere in the API to access it.Now,I have really no idea how to set it up in Unreal.If I create in in C++ then to expose it for blueprints I need to extend it in the editor which means,if I get it right ,it will become a completely new objects which existence is not known to the C++ side of the game.So what is the “Unreal” way to handle such a scenario?

But how do I enforce only a single instance of such an object across the program lifetime?

If you create the superclass in C++ and you set up every variable and function you want to reach with the correct macros, then you can reach them from both C++ and Blueprints.

Variables need to be set up as properties:
Unreal Engine UProperties | Unreal Engine Documentation ) with for eg. a BlueprintReadWrite specifier then by using its blueprint subclass you can read and write the specified property from both c++ and blueprint.

Same applies to functions, but there you would probably use a UFUNCTION with BlueprintNativeEvent for which function you can provide a c++ implementation, but you can override it in a blueprint subclass.
https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Reference/Functions/index.html

You have to make UObject the parent of the C++ class to be able to subclass it in a blueprint, but it will be garbagecollected if you dont keep a reference to it, so you should check out this post on how to keep a reference to it.

https://answers.unrealengine.com/questions/2698/proper-way-to-implement-a-uobject-singleton.html

I would probably store it in the gameplay class, which you can reach by

(ASomeGameMode*)GetWorld()->GetAuthGameMode()

as mentioned here:
https://answers.unrealengine.com/questions/25153/how-to-get-a-reference-to-my-gamemode-class-instan.html

Hmm,then maybe it would be wiser to use GameMode for storing global settings in the first place?

I suppose it depends on whether it’s just a few boolean variables in which case it’s fine, but if you really need a lot of variables and data to be stored, it’s probably a good idea to encapsulate it in a different class