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
| Signature | Name | Description |
|---|---|---|
MGameInstance() = default | MGameInstance |
Public functions
| Returns | Name | Description |
|---|---|---|
MGameInstance& | Get | |
MGameInstance* | TryGet | |
void | SetString | |
std::string | GetString | |
void | SetInt | |
int32_t | GetInt | |
void | SetFloat | |
float | GetFloat | |
void | SetBool | |
bool | GetBool | |
bool | HasValue | |
void | RemoveValue | |
void | ClearValues | |
int32_t | GetWorldCount | |
void | Set | Typed access for C++; a graph reaches the same store through the MFUNCTIONs above. |
const VisualScriptValue* | Find | |
std::vector<std::string> | Keys | |
void | NotifyWorldBegan | Bumped by the world lifecycle each time an actor world begins play. |
Function details
MGameInstance
C++
MGameInstance() = defaultGet
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) constSetInt
C++
void SetInt(const std::string& key, int32_t value)GetInt
C++
int32_t GetInt(const std::string& key, int32_t defaultValue) constSetFloat
C++
void SetFloat(const std::string& key, float value)GetFloat
C++
float GetFloat(const std::string& key, float defaultValue) constSetBool
C++
void SetBool(const std::string& key, bool value)GetBool
C++
bool GetBool(const std::string& key, bool defaultValue) constHasValue
C++
bool HasValue(const std::string& key) constRemoveValue
C++
void RemoveValue(const std::string& key)ClearValues
C++
void ClearValues()GetWorldCount
C++
int32_t GetWorldCount() constSet
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) constKeys
C++
std::vector<std::string> Keys() constNotifyWorldBegan
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