Download

How can I create a Blueprint Singleton Actor?

One of my game managers (c++ class) needs to have a Tick() function, be a singleton, be in the map, and have data assigned to it via Blueprint. It should also persist across level changes.

Is this something you can do in Unreal? For example in Unity you can just mark a game object with DontDestroyOnLoad(theGameObject) and it keeps running.

I think you are looking for the UGameInstance class

You can avoid the downsides of the singleton pattern by creating an instance of your class in an overridden UGameInstance::Init() and fetching it from the GameInstance when you need it.

See Also: