class

MGameInstance

The one object that outlives every world: UE's UGameInstance. A scene load or a map travel tears the actor world down with everything in it, so a value that must cross that boundary — the chosen difficulty, the lobby the party formed in, a run's seed — lives here, keyed by name. Created on first use and rooted for the process; a game subclasses nothing, it reads and writes the bag from C++ or from a Visual Script graph through MGameplayStatics::GetGameInstance.

Module
Game
Header
#include "Game/MGameInstance.h"
Namespace
Mowo
Reflection
Reflected by MowoHeaderTool

Constructors

SignatureNameDescription
MGameInstance() = defaultMGameInstance

Public functions

ReturnsNameDescription
MGameInstance&Get
MGameInstance*TryGet
voidSetString
std::stringGetString
voidSetInt
int32_tGetInt
voidSetFloat
floatGetFloat
voidSetBool
boolGetBool
boolHasValue
voidRemoveValue
voidClearValues
int32_tGetWorldCount
voidSetTyped access for C++; a graph reaches the same store through the MFUNCTIONs above.
const VisualScriptValue*Find
std::vector<std::string>Keys
voidNotifyWorldBeganBumped by the world lifecycle each time an actor world begins play.

Function details

MGameInstance

C++
MGameInstance() = default

Get

C++
static MGameInstance& Get()

TryGet

C++
static MGameInstance* TryGet()

SetString

C++
void SetString(const std::string& key, const std::string& value)

GetString

C++
std::string GetString(const std::string& key, const std::string& defaultValue) const

SetInt

C++
void SetInt(const std::string& key, int32_t value)

GetInt

C++
int32_t GetInt(const std::string& key, int32_t defaultValue) const

SetFloat

C++
void SetFloat(const std::string& key, float value)

GetFloat

C++
float GetFloat(const std::string& key, float defaultValue) const

SetBool

C++
void SetBool(const std::string& key, bool value)

GetBool

C++
bool GetBool(const std::string& key, bool defaultValue) const

HasValue

C++
bool HasValue(const std::string& key) const

RemoveValue

C++
void RemoveValue(const std::string& key)

ClearValues

C++
void ClearValues()

GetWorldCount

C++
int32_t GetWorldCount() const

Set

C++
void Set(const std::string& key, const VisualScriptValue& value)

Typed access for C++; a graph reaches the same store through the MFUNCTIONs above.

Find

C++
const VisualScriptValue* Find(const std::string& key) const

Keys

C++
std::vector<std::string> Keys() const

NotifyWorldBegan

C++
void NotifyWorldBegan()

Bumped by the world lifecycle each time an actor world begins play.

Generated from Game/MGameInstance.h via game.json · Nov 5, 2026Version 1.0.0