UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UGameInstance Class Reference

#include <GameInstance.h>

+ Inheritance diagram for UGameInstance:

Public Member Functions

virtual ENGINE_API class UWorldGetWorld () const final
 
virtual ENGINE_API void FinishDestroy () override
 
virtual ENGINE_API void Init ()
 
ENGINE_API void ReceiveInit ()
 
virtual ENGINE_API void Shutdown ()
 
ENGINE_API void ReceiveShutdown ()
 
virtual ENGINE_API void HandleInputDeviceConnectionChange (EInputDeviceConnectionState NewConnectionState, FPlatformUserId PlatformUserId, FInputDeviceId InputDeviceId)
 
virtual ENGINE_API void HandleInputDevicePairingChange (FInputDeviceId InputDeviceId, FPlatformUserId NewUserPlatformId, FPlatformUserId OldUserPlatformId)
 
ENGINE_API void HandleNetworkError (ENetworkFailure::Type FailureType, bool bIsServer)
 
ENGINE_API void HandleTravelError (ETravelFailure::Type FailureType)
 
ENGINE_API void InitializeStandalone (const FName InWorldName=NAME_None, UPackage *InWorldPackage=nullptr)
 
ENGINE_API void InitializeForMinimalNetRPC (const FName InPackageName)
 
ENGINE_API class UEngineGetEngine () const
 
struct FWorldContextGetWorldContext () const
 
ENGINE_API class UGameViewportClientGetGameViewportClient () const
 
virtual ENGINE_API void OnWorldChanged (UWorld *OldWorld, UWorld *NewWorld)
 
virtual ENGINE_API void StartGameInstance ()
 
virtual bool JoinSession (ULocalPlayer *LocalPlayer, int32 SessionIndexInSearchResults)
 
virtual bool JoinSession (ULocalPlayer *LocalPlayer, const FOnlineSessionSearchResult &SearchResult)
 
virtual void LoadComplete (const float LoadTime, const FString &MapName)
 
virtual ENGINE_API void DebugCreatePlayer (int32 ControllerId)
 
virtual ENGINE_API void DebugRemovePlayer (int32 ControllerId)
 
virtual ENGINE_API ULocalPlayerCreateInitialPlayer (FString &OutError)
 
ENGINE_API ULocalPlayerCreateLocalPlayer (int32 ControllerId, FString &OutError, bool bSpawnPlayerController)
 
ENGINE_API ULocalPlayerCreateLocalPlayer (FPlatformUserId UserId, FString &OutError, bool bSpawnPlayerController)
 
virtual ENGINE_API int32 AddLocalPlayer (ULocalPlayer *NewPlayer, FPlatformUserId UserId)
 
virtual ENGINE_API bool RemoveLocalPlayer (ULocalPlayer *ExistingPlayer)
 
ENGINE_API int32 GetNumLocalPlayers () const
 
ENGINE_API ULocalPlayerGetLocalPlayerByIndex (const int32 Index) const
 
ENGINE_API ULocalPlayerGetFirstGamePlayer () const
 
ENGINE_API APlayerControllerGetFirstLocalPlayerController (const UWorld *World=nullptr) const
 
ENGINE_API ULocalPlayerFindLocalPlayerFromControllerId (const int32 ControllerId) const
 
ENGINE_API ULocalPlayerFindLocalPlayerFromPlatformUserId (const FPlatformUserId UserId) const
 
ENGINE_API ULocalPlayerFindLocalPlayerFromDeviceId (const FInputDeviceId DeviceID) const
 
ENGINE_API ULocalPlayerFindLocalPlayerFromUniqueNetId (FUniqueNetIdPtr UniqueNetId) const
 
ENGINE_API ULocalPlayerFindLocalPlayerFromUniqueNetId (const FUniqueNetId &UniqueNetId) const
 
ENGINE_API ULocalPlayerFindLocalPlayerFromUniqueNetId (const FUniqueNetIdRepl &UniqueNetId) const
 
ENGINE_API TArray< ULocalPlayer * >::TConstIterator GetLocalPlayerIterator () const
 
ENGINE_API const TArray< ULocalPlayer * > & GetLocalPlayers () const
 
ENGINE_API APlayerControllerGetPrimaryPlayerController (bool bRequiresValidUniqueId=true) const
 
ENGINE_API FUniqueNetIdRepl GetPrimaryPlayerUniqueIdRepl () const
 
ENGINE_API void CleanupGameViewport ()
 
virtual PRAGMA_DISABLE_DEPRECATION_WARNINGS void HandleDemoPlaybackFailure (EDemoPlayFailure::Type FailureType, const FString &ErrorString=TEXT(""))
 
virtual PRAGMA_ENABLE_DEPRECATION_WARNINGS void HandleDemoPlaybackFailure (const UE::Net::TNetResult< EReplayResult > &Result)
 
virtual void HandleDemoRecordFailure (const UE::Net::TNetResult< EReplayResult > &Result)
 
virtual void OnSeamlessTravelDuringReplay ()
 
FTimerManagerGetTimerManager () const
 
FLatentActionManager & GetLatentActionManager () const
 
UGameInstanceSubsystemGetSubsystemBase (TSubclassOf< UGameInstanceSubsystem > SubsystemClass) const
 
template<typename TSubsystemClass >
TSubsystemClassGetSubsystem () const
 
template<typename TSubsystemClass >
TArray< TSubsystemClass * > GetSubsystemArrayCopy () const
 
template<typename TSubsystemClass >
void ForEachSubsystem (TFunctionRef< void(TSubsystemClass *)> Operation) const
 
virtual ENGINE_API void StartRecordingReplay (const FString &InName, const FString &FriendlyName, const TArray< FString > &AdditionalOptions=TArray< FString >(), TSharedPtr< IAnalyticsProvider > AnalyticsProvider=nullptr)
 
virtual ENGINE_API void StopRecordingReplay ()
 
virtual ENGINE_API bool PlayReplay (const FString &InName, UWorld *WorldOverride=nullptr, const TArray< FString > &AdditionalOptions=TArray< FString >())
 
virtual ENGINE_API bool IsReplayDeferred (const FString &ReplayName) const
 
ENGINE_API bool PlayReplayPlaylist (const struct FReplayPlaylistParams &PlaylistParams)
 
virtual ENGINE_API void AddUserToReplay (const FString &UserString)
 
virtual ENGINE_API bool EnableListenServer (bool bEnable, int32 PortOverride=0)
 
virtual void HandleGameNetControlMessage (class UNetConnection *Connection, uint8 MessageByte, const FString &MessageStr)
 
virtual ENGINE_API void ReceivedNetworkEncryptionToken (const FString &EncryptionToken, const FOnEncryptionKeyResponse &Delegate)
 
virtual ENGINE_API void ReceivedNetworkEncryptionAck (const FOnEncryptionKeyResponse &Delegate)
 
virtual ENGINE_API EEncryptionFailureAction ReceivedNetworkEncryptionFailure (UNetConnection *Connection)
 
virtual ENGINE_API void PreloadContentForURL (FURL InURL)
 
virtual ENGINE_API class AGameModeBase * CreateGameModeForURL (FURL InURL, UWorld *InWorld)
 
virtual ENGINE_API void SetPersistentTravelURL (FURL InURL)
 
virtual ENGINE_API TSubclassOf< AGameModeBase > OverrideGameModeClass (TSubclassOf< AGameModeBase > GameModeClass, const FString &MapName, const FString &Options, const FString &Portal) const
 
virtual void ModifyClientTravelLevelURL (FString &LevelName)
 
virtual bool DelayPendingNetGameTravel ()
 
virtual bool DelayCompletionOfPendingNetGameTravel ()
 
class UOnlineSessionGetOnlineSession () const
 
virtual ENGINE_API TSubclassOf< UOnlineSessionGetOnlineSessionClass ()
 
ENGINE_API bool IsDedicatedServerInstance () const
 
virtual ENGINE_API FName GetOnlinePlatformName () const
 
virtual ENGINE_API bool ClientTravelToSession (int32 ControllerId, FName InSessionName)
 
ENGINE_API void NotifyPreClientTravel (const FString &PendingURL, ETravelType TravelType, bool bIsSeamlessTravel)
 
FOnPreClientTravelOnNotifyPreClientTravel ()
 
FOnPawnControllerChangedGetOnPawnControllerChanged ()
 
virtual ENGINE_API void ReturnToMainMenu ()
 
virtual ENGINE_API void RegisterReferencedObject (UObject *ObjectToReference)
 
virtual ENGINE_API void UnregisterReferencedObject (UObject *ObjectToReference)
 
virtual ENGINE_API EReplicationSystem GetDesiredReplicationSystem (FName InNetDriverDefinition) const
 
virtual void OverrideIrisReplicationSystemConfig (FNetDriverReplicationSystemConfig &OutConfig, bool bIsServer) const
 
- Public Member Functions inherited from UObject
COREUOBJECT_API UObject ()
 
COREUOBJECT_API UObject (const FObjectInitializer &ObjectInitializer)
 
COREUOBJECT_API UObject (EStaticConstructor, EObjectFlags InFlags)
 
COREUOBJECT_API UObject (FVTableHelper &Helper)
 
COREUOBJECT_API UObjectCreateDefaultSubobject (FName SubobjectFName, UClass *ReturnType, UClass *ClassToCreateByDefault, bool bIsRequired, bool bIsTransient)
 
template<class TReturnType >
TReturnTypeCreateEditorOnlyDefaultSubobject (FName SubobjectName, bool bTransient=false)
 
template<class TReturnType >
TReturnTypeCreateDefaultSubobject (FName SubobjectName, bool bTransient=false)
 
template<class TReturnType , class TClassToConstructByDefault >
TReturnTypeCreateDefaultSubobject (FName SubobjectName, bool bTransient=false)
 
template<class TReturnType >
TReturnTypeCreateOptionalDefaultSubobject (FName SubobjectName, bool bTransient=false)
 
template<class TReturnType , class TClassToConstructByDefault >
TReturnTypeCreateOptionalDefaultSubobject (FName SubobjectName, bool bTransient=false)
 
COREUOBJECT_API void GetDefaultSubobjects (TArray< UObject * > &OutDefaultSubobjects)
 
COREUOBJECT_API UObjectGetDefaultSubobjectByName (FName ToFind)
 
virtual COREUOBJECT_API void PostInitProperties ()
 
virtual COREUOBJECT_API void PostReinitProperties ()
 
virtual void PostCDOContruct ()
 
virtual COREUOBJECT_API void PreSaveRoot (FObjectPreSaveRootContext ObjectSaveContext)
 
virtual COREUOBJECT_API void PostSaveRoot (FObjectPostSaveRootContext ObjectSaveContext)
 
virtual COREUOBJECT_API void PreSave (FObjectPreSaveContext SaveContext)
 
virtual COREUOBJECT_API void CollectSaveOverrides (FObjectCollectSaveOverridesContext SaveContext)
 
UE_FORCEINLINE_HINT bool Modify (bool bAlwaysMarkDirty=true)
 
UE_FORCEINLINE_HINT bool IsCapturingAsRootObjectForTransaction () const
 
virtual bool ResolveSubobject (const TCHAR *SubObjectPath, UObject *&OutObject, bool bLoadIfExists)
 
virtual bool IsReadyForAsyncPostLoad () const
 
virtual COREUOBJECT_API void PostLoad ()
 
virtual COREUOBJECT_API void PostLoadSubobjects (FObjectInstancingGraph *OuterInstanceGraph)
 
virtual COREUOBJECT_API void BeginDestroy ()
 
virtual bool IsReadyForFinishDestroy ()
 
virtual COREUOBJECT_API void Serialize (FArchive &Ar)
 
virtual COREUOBJECT_API void Serialize (FStructuredArchive::FRecord Record)
 
virtual void ShutdownAfterError ()
 
virtual void PostInterpChange (FProperty *PropertyThatChanged)
 
virtual COREUOBJECT_API void PostRename (UObject *OldOuter, const FName OldName)
 
virtual void PreDuplicate (FObjectDuplicationParameters &DupParams)
 
virtual void PostDuplicate (bool bDuplicateForPIE)
 
virtual void PostDuplicate (EDuplicateMode::Type DuplicateMode)
 
virtual COREUOBJECT_API bool NeedsLoadForClient () const
 
virtual COREUOBJECT_API bool NeedsLoadForServer () const
 
virtual COREUOBJECT_API bool NeedsLoadForTargetPlatform (const class ITargetPlatform *TargetPlatform) const
 
virtual bool NeedsLoadForEditorGame () const
 
virtual bool IsEditorOnly () const
 
virtual bool HasNonEditorOnlyReferences () const
 
virtual bool IsPostLoadThreadSafe () const
 
virtual COREUOBJECT_API bool IsDestructionThreadSafe () const
 
virtual COREUOBJECT_API void GetPreloadDependencies (TArray< UObject * > &OutDeps)
 
virtual void GetPrestreamPackages (TArray< UObject * > &OutPrestream)
 
virtual void ExportCustomProperties (FOutputDevice &Out, uint32 Indent)
 
virtual void ImportCustomProperties (const TCHAR *SourceText, FFeedbackContext *Warn)
 
virtual void PostEditImport ()
 
virtual void PostReloadConfig (class FProperty *PropertyThatWasLoaded)
 
virtual COREUOBJECT_API bool Rename (const TCHAR *NewName=nullptr, UObject *NewOuter=nullptr, ERenameFlags Flags=REN_None)
 
virtual FString GetDesc ()
 
COREUOBJECT_API UScriptStructGetSparseClassDataStruct () const
 
virtual bool GetNativePropertyValues (TMap< FString, FString > &out_PropertyValues, uint32 ExportFlags=0) const
 
virtual COREUOBJECT_API void GetResourceSizeEx (FResourceSizeEx &CumulativeResourceSize)
 
SIZE_T GetResourceSizeBytes (EResourceSizeMode::Type Mode)
 
virtual FName GetExporterName (void)
 
COREUOBJECT_API void CallAddReferencedObjects (FReferenceCollector &Collector)
 
virtual FRestoreForUObjectOverwriteGetRestoreForUObjectOverwrite ()
 
virtual bool AreNativePropertiesIdenticalTo (UObject *Other) const
 
virtual COREUOBJECT_API void GetAssetRegistryTags (FAssetRegistryTagsContext Context) const
 
virtual COREUOBJECT_API void GetAssetRegistryTags (TArray< FAssetRegistryTag > &OutTags) const
 
COREUOBJECT_API void GetAssetRegistryTags (FAssetData &Out) const
 
COREUOBJECT_API void GetAssetRegistryTags (FAssetRegistryTagsContext Context, FAssetData &Out) const
 
virtual COREUOBJECT_API bool IsAsset () const
 
virtual COREUOBJECT_API FPrimaryAssetId GetPrimaryAssetId () const
 
virtual COREUOBJECT_API bool IsLocalizedResource () const
 
virtual COREUOBJECT_API bool IsSafeForRootSet () const
 
virtual COREUOBJECT_API void TagSubobjects (EObjectFlags NewFlags)
 
virtual COREUOBJECT_API void GetLifetimeReplicatedProps (TArray< class FLifetimeProperty > &OutLifetimeProps) const
 
virtual COREUOBJECT_API void GetReplicatedCustomConditionState (FCustomPropertyConditionState &OutActiveState) const
 
virtual COREUOBJECT_API void RegisterReplicationFragments (UE::Net::FFragmentRegistrationContext &Context, UE::Net::EFragmentRegistrationFlags RegistrationFlags)
 
virtual COREUOBJECT_API bool IsNameStableForNetworking () const
 
virtual COREUOBJECT_API bool IsFullNameStableForNetworking () const
 
virtual COREUOBJECT_API bool IsSupportedForNetworking () const
 
virtual void GetSubobjectsWithStableNamesForNetworking (TArray< UObject * > &ObjList)
 
virtual COREUOBJECT_API void PreNetReceive ()
 
virtual COREUOBJECT_API void PostNetReceive ()
 
virtual void PostRepNotifies ()
 
virtual COREUOBJECT_API void PreDestroyFromReplication ()
 
COREUOBJECT_API bool IsSelected () const
 
COREUOBJECT_API void SerializeScriptProperties (FArchive &Ar) const
 
COREUOBJECT_API void SerializeScriptProperties (FStructuredArchive::FSlot Slot) const
 
COREUOBJECT_API void ReinitializeProperties (UObject *SourceObject=NULL, struct FObjectInstancingGraph *InstanceGraph=NULL)
 
COREUOBJECT_API FString GetDetailedInfo () const
 
COREUOBJECT_API bool ConditionalBeginDestroy ()
 
COREUOBJECT_API bool ConditionalFinishDestroy ()
 
COREUOBJECT_API void ConditionalPostLoad ()
 
COREUOBJECT_API void ConditionalPreload ()
 
COREUOBJECT_API void ConditionalPostLoadSubobjects (struct FObjectInstancingGraph *OuterInstanceGraph=NULL)
 
bool IsBasedOnArchetype (const UObject *const SomeObject) const
 
COREUOBJECT_API UFunctionFindFunction (FName InName) const
 
COREUOBJECT_API UFunctionFindFunctionChecked (FName InName) const
 
virtual COREUOBJECT_API void BuildSubobjectMapping (UObject *OtherObject, TMap< UObject *, UObject * > &ObjectMapping) const
 
COREUOBJECT_API void CollectDefaultSubobjects (TArray< UObject * > &OutDefaultSubobjects, bool bIncludeNestedSubobjects=false) const
 
COREUOBJECT_API bool CheckDefaultSubobjects (bool bForceCheck=false) const
 
COREUOBJECT_API void SaveConfig (uint64 RequiredPropertyFlags=CPF_Config, const TCHAR *Filename=nullptr, FConfigCacheIni *Config=GConfig, bool bAllowCopyToDefaultObject=true)
 
COREUOBJECT_API void SaveConfig (const FSaveConfigContext &Context)
 
COREUOBJECT_API void UpdateDefaultConfigFile (const FString &SpecificFileLocation="")
 
COREUOBJECT_API bool TryUpdateDefaultConfigFile (const FString &SpecificFileLocation="", bool bWarnIfFail=true)
 
COREUOBJECT_API void UpdateGlobalUserConfigFile ()
 
COREUOBJECT_API void UpdateProjectUserConfigFile ()
 
COREUOBJECT_API void UpdateSinglePropertyInConfigFile (const FProperty *InProperty, const FString &InConfigIniName)
 
COREUOBJECT_API FString GetDefaultConfigFilename () const
 
COREUOBJECT_API FString GetGlobalUserConfigFilename () const
 
COREUOBJECT_API FString GetProjectUserConfigFilename () const
 
virtual const TCHARGetConfigOverridePlatform () const
 
virtual void OverrideConfigSection (FString &SectionName)
 
virtual void OverridePerObjectConfigSection (FString &SectionName)
 
COREUOBJECT_API void LoadConfig (UClass *ConfigClass=nullptr, const TCHAR *Filename=nullptr, uint32 PropagationFlags=UE::LCPF_None, class FProperty *PropertyToLoad=nullptr, TArray< UE::ConfigAccessTracking::FConfigAccessData > *OutAccessedKeys=nullptr)
 
COREUOBJECT_API void ReloadConfig (UClass *ConfigClass=NULL, const TCHAR *Filename=NULL, uint32 PropagationFlags=UE::LCPF_None, class FProperty *PropertyToLoad=NULL)
 
COREUOBJECT_API void ParseParms (const TCHAR *Parms)
 
COREUOBJECT_API void OutputReferencers (FOutputDevice &Ar, FReferencerInformationList *Referencers=NULL)
 
COREUOBJECT_API void RetrieveReferencers (TArray< FReferencerInformation > *OutInternalReferencers, TArray< FReferencerInformation > *OutExternalReferencers)
 
COREUOBJECT_API void SetLinker (FLinkerLoad *LinkerLoad, int32 LinkerIndex, bool bShouldDetachExisting=true, bool bSilenceLogs=false)
 
COREUOBJECT_API UObjectGetArchetype () const
 
COREUOBJECT_API void GetArchetypeInstances (TArray< UObject * > &Instances)
 
COREUOBJECT_API void InstanceSubobjectTemplates (struct FObjectInstancingGraph *InstanceGraph=NULL)
 
template<class T >
bool Implements () const
 
virtual COREUOBJECT_API void ProcessEvent (UFunction *Function, void *Parms)
 
virtual int32 GetFunctionCallspace (UFunction *Function, FFrame *Stack)
 
virtual bool CallRemoteFunction (UFunction *Function, void *Parms, struct FOutParmRec *OutParms, FFrame *Stack)
 
COREUOBJECT_API bool CallFunctionByNameWithArguments (const TCHAR *Cmd, FOutputDevice &Ar, UObject *Executor, bool bForceCallWithNonExec=false)
 
COREUOBJECT_API void CallFunction (FFrame &Stack, RESULT_DECL, UFunction *Function)
 
 DECLARE_FUNCTION (ProcessInternal)
 
virtual bool ProcessConsoleExec (const TCHAR *Cmd, FOutputDevice &Ar, UObject *Executor)
 
COREUOBJECT_API void SkipFunction (FFrame &Stack, RESULT_DECL, UFunction *Function)
 
virtual UClassRegenerateClass (UClass *ClassToRegenerate, UObject *PreviousCDO)
 
COREUOBJECT_API bool IsInBlueprint () const
 
COREUOBJECT_API void DestroyNonNativeProperties ()
 
virtual void MarkAsEditorOnlySubobject ()
 
COREUOBJECT_API void AbortInsideMemberFunction () const
 
 DECLARE_FUNCTION (execUndefined)
 
 DECLARE_FUNCTION (execLocalVariable)
 
 DECLARE_FUNCTION (execInstanceVariable)
 
 DECLARE_FUNCTION (execDefaultVariable)
 
 DECLARE_FUNCTION (execLocalOutVariable)
 
 DECLARE_FUNCTION (execInterfaceVariable)
 
 DECLARE_FUNCTION (execClassSparseDataVariable)
 
 DECLARE_FUNCTION (execInterfaceContext)
 
 DECLARE_FUNCTION (execArrayElement)
 
 DECLARE_FUNCTION (execBoolVariable)
 
 DECLARE_FUNCTION (execClassDefaultVariable)
 
 DECLARE_FUNCTION (execEndFunctionParms)
 
 DECLARE_FUNCTION (execNothing)
 
 DECLARE_FUNCTION (execNothingInt32)
 
 DECLARE_FUNCTION (execNothingOp4a)
 
 DECLARE_FUNCTION (execBreakpoint)
 
 DECLARE_FUNCTION (execTracepoint)
 
 DECLARE_FUNCTION (execWireTracepoint)
 
 DECLARE_FUNCTION (execInstrumentation)
 
 DECLARE_FUNCTION (execEndOfScript)
 
 DECLARE_FUNCTION (execReturnNothing)
 
 DECLARE_FUNCTION (execEmptyParmValue)
 
 DECLARE_FUNCTION (execJump)
 
 DECLARE_FUNCTION (execJumpIfNot)
 
 DECLARE_FUNCTION (execAssert)
 
 DECLARE_FUNCTION (execPushExecutionFlow)
 
 DECLARE_FUNCTION (execPopExecutionFlow)
 
 DECLARE_FUNCTION (execComputedJump)
 
 DECLARE_FUNCTION (execPopExecutionFlowIfNot)
 
 DECLARE_FUNCTION (execLet)
 
 DECLARE_FUNCTION (execLetObj)
 
 DECLARE_FUNCTION (execLetWeakObjPtr)
 
 DECLARE_FUNCTION (execLetBool)
 
 DECLARE_FUNCTION (execLetDelegate)
 
 DECLARE_FUNCTION (execLetMulticastDelegate)
 
 DECLARE_FUNCTION (execAddMulticastDelegate)
 
 DECLARE_FUNCTION (execClearMulticastDelegate)
 
 DECLARE_FUNCTION (execEatReturnValue)
 
 DECLARE_FUNCTION (execRemoveMulticastDelegate)
 
 DECLARE_FUNCTION (execSelf)
 
 DECLARE_FUNCTION (execContext)
 
 DECLARE_FUNCTION (execContext_FailSilent)
 
 DECLARE_FUNCTION (execStructMemberContext)
 
 DECLARE_FUNCTION (execVirtualFunction)
 
 DECLARE_FUNCTION (execFinalFunction)
 
 DECLARE_FUNCTION (execLocalVirtualFunction)
 
 DECLARE_FUNCTION (execLocalFinalFunction)
 
 DECLARE_FUNCTION (execStructCmpEq)
 
 DECLARE_FUNCTION (execStructCmpNe)
 
 DECLARE_FUNCTION (execStructMember)
 
 DECLARE_FUNCTION (execEqualEqual_DelegateDelegate)
 
 DECLARE_FUNCTION (execNotEqual_DelegateDelegate)
 
 DECLARE_FUNCTION (execEqualEqual_DelegateFunction)
 
 DECLARE_FUNCTION (execNotEqual_DelegateFunction)
 
 DECLARE_FUNCTION (execIntConst)
 
 DECLARE_FUNCTION (execInt64Const)
 
 DECLARE_FUNCTION (execUInt64Const)
 
 DECLARE_FUNCTION (execSkipOffsetConst)
 
 DECLARE_FUNCTION (execFloatConst)
 
 DECLARE_FUNCTION (execDoubleConst)
 
 DECLARE_FUNCTION (execStringConst)
 
 DECLARE_FUNCTION (execUnicodeStringConst)
 
 DECLARE_FUNCTION (execTextConst)
 
 DECLARE_FUNCTION (execPropertyConst)
 
 DECLARE_FUNCTION (execObjectConst)
 
 DECLARE_FUNCTION (execSoftObjectConst)
 
 DECLARE_FUNCTION (execFieldPathConst)
 
 DECLARE_FUNCTION (execInstanceDelegate)
 
 DECLARE_FUNCTION (execNameConst)
 
 DECLARE_FUNCTION (execByteConst)
 
 DECLARE_FUNCTION (execIntZero)
 
 DECLARE_FUNCTION (execIntOne)
 
 DECLARE_FUNCTION (execTrue)
 
 DECLARE_FUNCTION (execFalse)
 
 DECLARE_FUNCTION (execNoObject)
 
 DECLARE_FUNCTION (execNullInterface)
 
 DECLARE_FUNCTION (execIntConstByte)
 
 DECLARE_FUNCTION (execRotationConst)
 
 DECLARE_FUNCTION (execVectorConst)
 
 DECLARE_FUNCTION (execVector3fConst)
 
 DECLARE_FUNCTION (execTransformConst)
 
 DECLARE_FUNCTION (execStructConst)
 
 DECLARE_FUNCTION (execSetArray)
 
 DECLARE_FUNCTION (execSetSet)
 
 DECLARE_FUNCTION (execSetMap)
 
 DECLARE_FUNCTION (execArrayConst)
 
 DECLARE_FUNCTION (execSetConst)
 
 DECLARE_FUNCTION (execMapConst)
 
 DECLARE_FUNCTION (execBitFieldConst)
 
 DECLARE_FUNCTION (execNew)
 
 DECLARE_FUNCTION (execClassContext)
 
 DECLARE_FUNCTION (execNativeParm)
 
 DECLARE_FUNCTION (execCast)
 
 DECLARE_FUNCTION (execDynamicCast)
 
 DECLARE_FUNCTION (execMetaCast)
 
 DECLARE_FUNCTION (execInterfaceCast)
 
 DECLARE_FUNCTION (execDoubleToFloatCast)
 
 DECLARE_FUNCTION (execFloatToDoubleCast)
 
 DECLARE_FUNCTION (execObjectToBool)
 
 DECLARE_FUNCTION (execInterfaceToBool)
 
 DECLARE_FUNCTION (execObjectToInterface)
 
 DECLARE_FUNCTION (execInterfaceToInterface)
 
 DECLARE_FUNCTION (execInterfaceToObject)
 
 DECLARE_FUNCTION (execGetDynArrayElement)
 
 DECLARE_FUNCTION (execSetDynArrayElement)
 
 DECLARE_FUNCTION (execGetDynArrayLength)
 
 DECLARE_FUNCTION (execSetDynArrayLength)
 
 DECLARE_FUNCTION (execDynArrayInsert)
 
 DECLARE_FUNCTION (execDynArrayRemove)
 
 DECLARE_FUNCTION (execDynArrayFind)
 
 DECLARE_FUNCTION (execDynArrayFindStruct)
 
 DECLARE_FUNCTION (execDynArrayAdd)
 
 DECLARE_FUNCTION (execDynArrayAddItem)
 
 DECLARE_FUNCTION (execDynArrayInsertItem)
 
 DECLARE_FUNCTION (execDynArrayRemoveItem)
 
 DECLARE_FUNCTION (execDynArraySort)
 
 DECLARE_FUNCTION (execBindDelegate)
 
 DECLARE_FUNCTION (execCallMulticastDelegate)
 
 DECLARE_FUNCTION (execLetValueOnPersistentFrame)
 
 DECLARE_FUNCTION (execCallMathFunction)
 
 DECLARE_FUNCTION (execSwitchValue)
 
 DECLARE_FUNCTION (execArrayGetByRef)
 
 DECLARE_FUNCTION (execAutoRtfmTransact)
 
 DECLARE_FUNCTION (execAutoRtfmStopTransact)
 
 DECLARE_FUNCTION (execAutoRtfmAbortIfNot)
 
void ExecuteUbergraph (int32 EntryPoint)
 
virtual void ValidateGeneratedRepEnums (const TArray< struct FRepRecord > &ClassReps) const
 
virtual uint64 GetNetPushIdDynamic () const
 
- Public Member Functions inherited from UObjectBaseUtility
 UObjectBaseUtility ()
 
 UObjectBaseUtility (EObjectFlags InFlags)
 
void SetFlags (EObjectFlags NewFlags)
 
void ClearFlags (EObjectFlags FlagsToClear)
 
bool HasAnyFlags (EObjectFlags FlagsToCheck) const
 
bool HasAllFlags (EObjectFlags FlagsToCheck) const
 
UE_FORCEINLINE_HINT EObjectFlags GetMaskedFlags (EObjectFlags Mask=RF_AllFlags) const
 
UE_FORCEINLINE_HINT void Mark (EObjectMark Marks) const
 
UE_FORCEINLINE_HINT void UnMark (EObjectMark Marks) const
 
UE_FORCEINLINE_HINT bool HasAnyMarks (EObjectMark Marks) const
 
UE_FORCEINLINE_HINT bool HasAllMarks (EObjectMark Marks) const
 
UE_FORCEINLINE_HINT EObjectMark GetAllMarks () const
 
void MarkAsGarbage ()
 
void ClearGarbage ()
 
UE_FORCEINLINE_HINT void AddToRoot ()
 
UE_FORCEINLINE_HINT void RemoveFromRoot ()
 
UE_FORCEINLINE_HINT bool IsRooted () const
 
UE_FORCEINLINE_HINT int32 GetRefCount () const
 
bool ThisThreadAtomicallyClearedRFUnreachable ()
 
UE_FORCEINLINE_HINT bool IsUnreachable () const
 
UE_FORCEINLINE_HINT bool IsNative () const
 
void SetInternalFlags (EInternalObjectFlags FlagsToSet) const
 
UE_FORCEINLINE_HINT EInternalObjectFlags GetInternalFlags () const
 
UE_FORCEINLINE_HINT bool HasAnyInternalFlags (EInternalObjectFlags FlagsToCheck) const
 
void ClearInternalFlags (EInternalObjectFlags FlagsToClear) const
 
bool AtomicallyClearInternalFlags (EInternalObjectFlags FlagsToClear) const
 
COREUOBJECT_API FString GetFullName (const UObject *StopOuter=NULL, EObjectFullNameFlags Flags=EObjectFullNameFlags::None) const
 
COREUOBJECT_API void GetFullName (const UObject *StopOuter, FString &ResultString, EObjectFullNameFlags Flags=EObjectFullNameFlags::None) const
 
COREUOBJECT_API void GetFullName (FStringBuilderBase &ResultString, const UObject *StopOuter=NULL, EObjectFullNameFlags Flags=EObjectFullNameFlags::None) const
 
COREUOBJECT_API FString GetPathName (const UObject *StopOuter=NULL) const
 
COREUOBJECT_API void GetPathName (const UObject *StopOuter, FString &ResultString) const
 
COREUOBJECT_API void GetPathName (const UObject *StopOuter, FStringBuilderBase &ResultString) const
 
virtual bool CanBeClusterRoot () const
 
virtual COREUOBJECT_API bool CanBeInCluster () const
 
virtual COREUOBJECT_API void CreateCluster ()
 
virtual void OnClusterMarkedAsPendingKill ()
 
COREUOBJECT_API void AddToCluster (UObjectBaseUtility *ClusterRootOrObjectFromCluster, bool bAddAsMutableObject=false)
 
COREUOBJECT_API FString GetFullGroupName (bool bStartWithOuter) const
 
UE_FORCEINLINE_HINT FString GetName () const
 
UE_FORCEINLINE_HINT void GetName (FString &ResultString) const
 
UE_FORCEINLINE_HINT void AppendName (FString &ResultString) const
 
COREUOBJECT_API bool IsPackageExternal () const
 
COREUOBJECT_API void DetachExternalPackage ()
 
COREUOBJECT_API void ReattachExternalPackage ()
 
COREUOBJECT_API UObjectGetOutermostObject () const
 
COREUOBJECT_API UPackageGetPackage () const
 
UE_INTERNAL virtual COREUOBJECT_API UE::Core::FVersePath GetVersePath () const
 
COREUOBJECT_API UPackageGetOutermost () const
 
COREUOBJECT_API bool MarkPackageDirty () const
 
COREUOBJECT_API bool IsTemplate (EObjectFlags TemplateTypes=RF_ArchetypeObject|RF_ClassDefaultObject) const
 
COREUOBJECT_API UObjectGetTypedOuter (UClass *Target) const
 
template<typename T >
T * GetTypedOuter () const
 
template<typename InterfaceClassType >
InterfaceClassTypeGetImplementingOuter () const
 
COREUOBJECT_API UObjectBaseUtilityGetImplementingOuterObject (const UClass *InInterfaceClass) const
 
COREUOBJECT_API bool IsIn (const UObject *SomeOuter) const
 
COREUOBJECT_API bool IsIn (const UPackage *SomePackage) const
 
COREUOBJECT_API bool IsInOuter (const UObject *SomeOuter) const
 
COREUOBJECT_API bool IsInPackage (const UPackage *SomePackage) const
 
COREUOBJECT_API bool IsInA (const UClass *SomeBaseClass) const
 
COREUOBJECT_API bool RootPackageHasAnyFlags (uint32 CheckFlagMask) const
 
template<typename OtherClassType >
bool IsA (OtherClassType SomeBase) const
 
template<class T >
bool IsA () const
 
COREUOBJECT_API const UClassFindNearestCommonBaseClass (const UClass *TestClass) const
 
COREUOBJECT_API voidGetInterfaceAddress (UClass *InterfaceClass)
 
COREUOBJECT_API voidGetNativeInterfaceAddress (UClass *InterfaceClass)
 
const voidGetNativeInterfaceAddress (UClass *InterfaceClass) const
 
COREUOBJECT_API bool IsTemplateForSubobjects (EObjectFlags TemplateTypes=RF_ClassDefaultObject|RF_DefaultSubObject|RF_InheritableComponentTemplate) const
 
COREUOBJECT_API bool IsDefaultSubobject () const
 
COREUOBJECT_API class FLinkerLoadGetLinker () const
 
COREUOBJECT_API int32 GetLinkerIndex () const
 
COREUOBJECT_API FPackageFileVersion GetLinkerUEVersion () const
 
int32 GetLinkerUE4Version () const
 
COREUOBJECT_API int32 GetLinkerLicenseeUEVersion () const
 
int32 GetLinkerLicenseeUE4Version () const
 
COREUOBJECT_API int32 GetLinkerCustomVersion (FGuid CustomVersionKey) const
 
UE_FORCEINLINE_HINT bool operator< (const UObjectBaseUtility &Other) const
 
TStatId GetStatID (bool bForDeferredUse=false) const
 
- Public Member Functions inherited from UObjectBase
COREUOBJECT_API UObjectBase (UClass *InClass, EObjectFlags InFlags, EInternalObjectFlags InInternalFlags, UObject *InOuter, FName InName, int32 InInternalIndex=-1, int32 InSerialNumber=0, FRemoteObjectId InRemoteId=FRemoteObjectId())
 
virtual COREUOBJECT_API ~UObjectBase ()
 
COREUOBJECT_API bool IsValidLowLevel () const
 
COREUOBJECT_API bool IsValidLowLevelFast (bool bRecursive=true) const
 
FORCEINLINE uint32 GetUniqueID () const
 
FORCEINLINE UClassGetClass () const
 
FORCEINLINE UObjectGetOuter () const
 
FORCEINLINE FName GetFName () const
 
virtual COREUOBJECT_API FName GetFNameForStatID () const
 
COREUOBJECT_API UPackageGetExternalPackage () const
 
COREUOBJECT_API void SetExternalPackage (UPackage *InPackage)
 
COREUOBJECT_API UPackageGetExternalPackageInternal () const
 
COREUOBJECT_API void MarkAsReachable () const
 
COREUOBJECT_API void AddRef () const
 
COREUOBJECT_API void ReleaseRef () const
 
FORCEINLINE EObjectFlags GetFlags () const
 
FORCENOINLINE void AtomicallySetFlags (EObjectFlags FlagsToAdd)
 
FORCENOINLINE void AtomicallyClearFlags (EObjectFlags FlagsToClear)
 
- Public Member Functions inherited from FExec
virtual CORE_API ~FExec ()
 
virtual CORE_API bool Exec (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 

Static Public Member Functions

static ENGINE_API void AddReferencedObjects (UObject *InThis, FReferenceCollector &Collector)
 
static ENGINE_API void CreateMinimalNetRPCWorld (const FName InPackageName, UPackage *&OutWorldPackage, UWorld *&OutWorld)
 
template<typename TSubsystemClass >
static TSubsystemClassGetSubsystem (const UGameInstance *GameInstance)
 
- Static Public Member Functions inherited from UObject
static COREUOBJECT_API void UpdateClassesExcludedFromDedicatedServer (const TArray< FString > &InClassNames, const TArray< FString > &InModulesNames)
 
static COREUOBJECT_API void UpdateClassesExcludedFromDedicatedClient (const TArray< FString > &InClassNames, const TArray< FString > &InModulesNames)
 
static COREUOBJECT_API bool CanCreateInCurrentContext (UObject *Template)
 
static COREUOBJECT_API void AddReferencedObjects (UObject *InThis, FReferenceCollector &Collector)
 
static COREUOBJECT_API const FNameSourceFileTagName ()
 
static COREUOBJECT_API UObjectGetArchetypeFromRequiredInfo (const UClass *Class, const UObject *Outer, FName Name, EObjectFlags ObjectFlags)
 
- Static Public Member Functions inherited from UObjectBaseUtility
static bool IsGarbageEliminationEnabled ()
 
static bool IsPendingKillEnabled ()
 
static void SetGarbageEliminationEnabled (bool bEnabled)
 
static COREUOBJECT_API void ReloadObjectsFromModifiedConfigSections (const class FConfigModificationTracker *ChangeTracker)
 
- Static Public Member Functions inherited from UObjectBase
static COREUOBJECT_API FString RemoveClassPrefix (const TCHAR *ClassName)
 
static void PrefetchClass (UObject *Object)
 
static void PrefetchOuter (UObject *Object)
 

Public Attributes

FString PIEMapName
 
FOnUserInputDeviceConnectionChange OnInputDeviceConnectionChange
 
FOnUserInputDevicePairingChange OnUserInputDevicePairingChange
 
FOnLocalPlayerEvent OnLocalPlayerAddedEvent
 
FOnLocalPlayerEvent OnLocalPlayerRemovedEvent
 
FTimerManagerTimerManager
 
FLatentActionManager * LatentActionManager
 

Protected Member Functions

virtual ENGINE_API bool HandleOpenCommand (const TCHAR *Cmd, FOutputDevice &Ar, UWorld *InWorld)
 
virtual ENGINE_API bool HandleDisconnectCommand (const TCHAR *Cmd, FOutputDevice &Ar, UWorld *InWorld)
 
virtual ENGINE_API bool HandleReconnectCommand (const TCHAR *Cmd, FOutputDevice &Ar, UWorld *InWorld)
 
virtual ENGINE_API bool HandleTravelCommand (const TCHAR *Cmd, FOutputDevice &Ar, UWorld *InWorld)
 
ENGINE_API void OnPlayTogetherEventReceived (int32 UserIndex, const TArray< const FUniqueNetId & > &UserList)
 
ENGINE_API void OnConsoleInput (const FString &Command)
 
ENGINE_API void BroadcastOnStart ()
 
virtual ENGINE_API void OnStart ()
 
- Protected Member Functions inherited from UObject
virtual FString GetDetailedInfoInternal () const
 
COREUOBJECT_API bool CanCheckDefaultSubObjects (bool bForceCheck, bool &bResult) const
 
virtual COREUOBJECT_API bool CheckDefaultSubobjectsInternal () const
 
- Protected Member Functions inherited from UObjectBase
 UObjectBase ()
 
COREUOBJECT_API UObjectBase (EObjectFlags InFlags)
 
COREUOBJECT_API void LowLevelRename (FName NewName, UObject *NewOuter=NULL)
 
virtual void RegisterDependencies ()
 
COREUOBJECT_API void Register (class UClass *(*StaticClassFn)(), const TCHAR *PackageName, const TCHAR *Name)
 
COREUOBJECT_API void Register (const TCHAR *PackageName, const TCHAR *Name)
 
virtual COREUOBJECT_API void DeferredRegister (UClass *UClassStaticClass, const TCHAR *PackageName, const TCHAR *Name)
 
FORCEINLINE void SetFlagsTo (EObjectFlags NewFlags)
 
- Protected Member Functions inherited from FExec
virtual bool Exec_Runtime (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 
virtual bool Exec_Dev (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 
virtual bool Exec_Editor (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 

Static Protected Member Functions

static ENGINE_API bool GetMapOverrideName (const TCHAR *CmdLine, FString &OverrideMapName)
 

Protected Attributes

struct FWorldContextWorldContext
 
TArray< TObjectPtr< ULocalPlayer > > LocalPlayers
 
TObjectPtr< class UOnlineSessionOnlineSession
 
TArray< TObjectPtr< UObject > > ReferencedObjects
 
FOnPreClientTravel NotifyPreClientTravelDelegates
 
FOnPawnControllerChanged OnPawnControllerChangedDelegates
 
FDelegateHandle OnPlayTogetherEventReceivedDelegateHandle
 

Additional Inherited Members

- Public Types inherited from UObject
enum class  ENetFields_Private { NETFIELD_REP_START = 0 , NETFIELD_REP_END = -1 }
 
typedef UObject WithinClass
 

Detailed Description

GameInstance: high-level manager object for an instance of the running game. Spawned at game creation and not destroyed until game instance is shut down. Running as a standalone game, there will be one of these. Running in PIE (play-in-editor) will generate one of these per PIE instance.

Examples
/work/Engine/Source/Runtime/UMG/Public/Components/Widget.h.

Member Function Documentation

◆ AddLocalPlayer()

int32 UGameInstance::AddLocalPlayer ( ULocalPlayer NewPlayer,
FPlatformUserId  UserId 
)
virtual

Adds a LocalPlayer to the local and global list of Players.

Parameters
NewPlayerThe player to add
UserIdId of the platform user associated with the player

◆ AddReferencedObjects()

void UGameInstance::AddReferencedObjects ( UObject InThis,
FReferenceCollector Collector 
)
static

◆ AddUserToReplay()

void UGameInstance::AddUserToReplay ( const FString &  UserString)
virtual

Adds a join-in-progress user to the set of users associated with the currently recording replay (if any)

Parameters
UserStringa string that uniquely identifies the user, usually their FUniqueNetId

◆ BroadcastOnStart()

void UGameInstance::BroadcastOnStart ( )
protected

Non-virtual dispatch for OnStart, also calls the associated global OnStartGameInstance.

◆ CleanupGameViewport()

void UGameInstance::CleanupGameViewport ( )

◆ ClientTravelToSession()

bool UGameInstance::ClientTravelToSession ( int32  ControllerId,
FName  InSessionName 
)
virtual

Helper function for traveling to a session that has already been joined via the online platform Grabs the URL from the session info and travels

Parameters
ControllerIdcontroller initiating the request
InSessionNamename of session to travel to
Returns
true if able or attempting to travel, false otherwise

◆ CreateGameModeForURL()

AGameModeBase * UGameInstance::CreateGameModeForURL ( FURL  InURL,
UWorld InWorld 
)
virtual

Call to create the game mode for a given map URL

◆ CreateInitialPlayer()

ULocalPlayer * UGameInstance::CreateInitialPlayer ( FString &  OutError)
virtual

◆ CreateLocalPlayer() [1/2]

ULocalPlayer * UGameInstance::CreateLocalPlayer ( FPlatformUserId  UserId,
FString &  OutError,
bool  bSpawnPlayerController 
)

Adds a new player.

Parameters
UserId- The platform user id the player should accept input from
OutError- If no player is returned, OutError will contain a string describing the reason.
bSpawnPlayerController- True if a player controller should be spawned immediately for the new player.
Returns
The player which was created.

◆ CreateLocalPlayer() [2/2]

ULocalPlayer * UGameInstance::CreateLocalPlayer ( int32  ControllerId,
FString &  OutError,
bool  bSpawnPlayerController 
)

Adds a new player.

Parameters
ControllerId- The controller ID the player should accept input from.
OutError- If no player is returned, OutError will contain a string describing the reason.
bSpawnPlayerController- True if a player controller should be spawned immediately for the new player.
Returns
The player which was created.

◆ CreateMinimalNetRPCWorld()

void UGameInstance::CreateMinimalNetRPCWorld ( const FName  InPackageName,
UPackage *&  OutWorldPackage,
UWorld *&  OutWorld 
)
static

Static util function used by InitializeForMinimalNetRPC and LoadMap to create the minimal world suitable for basic network RPC

◆ DebugCreatePlayer()

void UGameInstance::DebugCreatePlayer ( int32  ControllerId)
virtual

Debug console command to create a player.

Parameters
ControllerId- The controller ID the player should accept input from.

◆ DebugRemovePlayer()

void UGameInstance::DebugRemovePlayer ( int32  ControllerId)
virtual

Debug console command to remove the player with a given controller ID.

Parameters
ControllerId- The controller ID to search for.

◆ DelayCompletionOfPendingNetGameTravel()

virtual bool UGameInstance::DelayCompletionOfPendingNetGameTravel ( )
inlinevirtual

return true to delay player controller spawn (sending NMT_Join)

◆ DelayPendingNetGameTravel()

virtual bool UGameInstance::DelayPendingNetGameTravel ( )
inlinevirtual

return true to delay an otherwise ready-to-join PendingNetGame performing LoadMap() and finishing up useful to wait for content downloads, etc

◆ EnableListenServer()

bool UGameInstance::EnableListenServer ( bool  bEnable,
int32  PortOverride = 0 
)
virtual

Turns on/off listen server capability for a game instance By default this will set up the persistent URL state so it persists across server travels and spawn the appropriate network listener

Parameters
bEnableturn on or off the listen server
PortOverridewill use this specific port, or if 0 will use the URL default port
Returns
true if desired settings were applied, games can override to deny changes in certain states

◆ FindLocalPlayerFromControllerId()

ULocalPlayer * UGameInstance::FindLocalPlayerFromControllerId ( const int32  ControllerId) const

Returns the local player assigned to a physical Controller Id, or null if not found

◆ FindLocalPlayerFromDeviceId()

ULocalPlayer * UGameInstance::FindLocalPlayerFromDeviceId ( const FInputDeviceId  DeviceID) const

Returns the local player who the given input device is assigned to. Null if not found

◆ FindLocalPlayerFromPlatformUserId()

ULocalPlayer * UGameInstance::FindLocalPlayerFromPlatformUserId ( const FPlatformUserId  UserId) const

Returns the local player assigned to this platform user id, or null if not found

◆ FindLocalPlayerFromUniqueNetId() [1/3]

ULocalPlayer * UGameInstance::FindLocalPlayerFromUniqueNetId ( const FUniqueNetId UniqueNetId) const

◆ FindLocalPlayerFromUniqueNetId() [2/3]

ULocalPlayer * UGameInstance::FindLocalPlayerFromUniqueNetId ( const FUniqueNetIdRepl UniqueNetId) const

◆ FindLocalPlayerFromUniqueNetId() [3/3]

ULocalPlayer * UGameInstance::FindLocalPlayerFromUniqueNetId ( FUniqueNetIdPtr  UniqueNetId) const

Returns the local player that has been assigned the specific unique net id

◆ FinishDestroy()

void UGameInstance::FinishDestroy ( )
overridevirtual

Called to finish destroying the object. After UObject::FinishDestroy is called, the object's memory should no longer be accessed.

Warning
Because properties are destroyed here, Super::FinishDestroy() should always be called at the end of your child class's FinishDestroy() method, rather than at the beginning.

Reimplemented from UObject.

◆ ForEachSubsystem()

void UGameInstance::ForEachSubsystem ( TFunctionRef< void(TSubsystemClass *)>  Operation) const
inline

Performs an operation on all Subsystems of specified type, this is only necessary for interfaces that can have multiple implementations instanced at a time.

◆ GetDesiredReplicationSystem()

EReplicationSystem UGameInstance::GetDesiredReplicationSystem ( FName  InNetDriverDefinition) const
virtual

Allows a GameInstance to override the default configured replication system for it's specific conditions. Return Default to use the configured replication system.

◆ GetEngine()

UEngine * UGameInstance::GetEngine ( ) const

◆ GetFirstGamePlayer()

ULocalPlayer * UGameInstance::GetFirstGamePlayer ( ) const

Returns the first local player, will not be null during normal gameplay

◆ GetFirstLocalPlayerController()

APlayerController * UGameInstance::GetFirstLocalPlayerController ( const UWorld World = nullptr) const

Returns the player controller assigned to the first local player. If World is specified it will search within that specific world

◆ GetGameViewportClient()

UGameViewportClient * UGameInstance::GetGameViewportClient ( ) const

◆ GetLatentActionManager()

FLatentActionManager & UGameInstance::GetLatentActionManager ( ) const
inline

◆ GetLocalPlayerByIndex()

ULocalPlayer * UGameInstance::GetLocalPlayerByIndex ( const int32  Index) const

Returns the local player at a certain index, or null if not found

◆ GetLocalPlayerIterator()

TArray< classULocalPlayer * >::TConstIterator UGameInstance::GetLocalPlayerIterator ( ) const

Returns const iterator for searching list of local players

◆ GetLocalPlayers()

const TArray< class ULocalPlayer * > & UGameInstance::GetLocalPlayers ( ) const

Returns reference to entire local player list

◆ GetMapOverrideName()

bool UGameInstance::GetMapOverrideName ( const TCHAR CmdLine,
FString &  OverrideMapName 
)
staticprotected

Find a map override argument on the command-line string (the first argument without a leading '-' or -map=..., whichever comes first).

◆ GetNumLocalPlayers()

int32 UGameInstance::GetNumLocalPlayers ( ) const

Returns number of fully registered local players

◆ GetOnlinePlatformName()

FName UGameInstance::GetOnlinePlatformName ( ) const
virtual

Retrieves the name of the online subsystem for the platform used by this instance. This will be used as the value of the PlayerOnlinePlatformName parameter in the NMT_Login message when this client connects to a server. Normally this will be the same as the DefaultPlatformService config value, but games may override it if they need non-default behavior (for example, if they are using multiple online subsystems at the same time).

◆ GetOnlineSession()

class UOnlineSession * UGameInstance::GetOnlineSession ( ) const
inline
Returns
online session management object associated with this game instance

◆ GetOnlineSessionClass()

TSubclassOf< UOnlineSession > UGameInstance::GetOnlineSessionClass ( )
virtual
Returns
OnlineSession class to use for this game instance

◆ GetOnPawnControllerChanged()

FOnPawnControllerChanged & UGameInstance::GetOnPawnControllerChanged ( )
inline
Returns
delegate broadcasted shortly after pawn's controller is set

◆ GetPrimaryPlayerController()

APlayerController * UGameInstance::GetPrimaryPlayerController ( bool  bRequiresValidUniqueId = true) const

Get the primary player controller on this machine (others are splitscreen children) (must have valid player state)

Parameters
bRequiresValidUniqueId- Whether the controller must also have a valid unique id (default true in order to maintain historical behaviour)
Returns
the primary controller on this machine

◆ GetPrimaryPlayerUniqueIdRepl()

FUniqueNetIdRepl UGameInstance::GetPrimaryPlayerUniqueIdRepl ( ) const

Get the unique id for the primary player on this machine (others are splitscreen children)

Returns
the unique id of the primary player on this machine

◆ GetSubsystem() [1/2]

TSubsystemClass * UGameInstance::GetSubsystem ( ) const
inline

Get a Subsystem of specified type

◆ GetSubsystem() [2/2]

static TSubsystemClass * UGameInstance::GetSubsystem ( const UGameInstance GameInstance)
inlinestatic

Get a Subsystem of specified type from the provided GameInstance returns nullptr if the Subsystem cannot be found or the GameInstance is null

◆ GetSubsystemArrayCopy()

TArray< TSubsystemClass * > UGameInstance::GetSubsystemArrayCopy ( ) const
inline

Get all Subsystems of specified type, this is only necessary for interfaces that can have multiple implementations instanced at a time.

◆ GetSubsystemBase()

UGameInstanceSubsystem * UGameInstance::GetSubsystemBase ( TSubclassOf< UGameInstanceSubsystem SubsystemClass) const
inline

Get a Subsystem of specified type

◆ GetTimerManager()

FTimerManager & UGameInstance::GetTimerManager ( ) const
inline

◆ GetWorld()

UWorld * UGameInstance::GetWorld ( ) const
finalvirtual

◆ GetWorldContext()

struct FWorldContext * UGameInstance::GetWorldContext ( ) const
inline

◆ HandleDemoPlaybackFailure() [1/2]

virtual PRAGMA_ENABLE_DEPRECATION_WARNINGS void UGameInstance::HandleDemoPlaybackFailure ( const UE::Net::TNetResult< EReplayResult > &  Result)
inlinevirtual

◆ HandleDemoPlaybackFailure() [2/2]

virtual PRAGMA_DISABLE_DEPRECATION_WARNINGS void UGameInstance::HandleDemoPlaybackFailure ( EDemoPlayFailure::Type  FailureType,
const FString &  ErrorString = TEXT("") 
)
inlinevirtual

Called when demo playback fails for any reason

◆ HandleDemoRecordFailure()

virtual void UGameInstance::HandleDemoRecordFailure ( const UE::Net::TNetResult< EReplayResult > &  Result)
inlinevirtual

Called when demo recording fails for any reason

◆ HandleDisconnectCommand()

bool UGameInstance::HandleDisconnectCommand ( const TCHAR Cmd,
FOutputDevice Ar,
UWorld InWorld 
)
protectedvirtual

◆ HandleGameNetControlMessage()

virtual void UGameInstance::HandleGameNetControlMessage ( class UNetConnection Connection,
uint8  MessageByte,
const FString &  MessageStr 
)
inlinevirtual

handle a game specific net control message (NMT_GameSpecific) this allows games to insert their own logic into the control channel the meaning of both data parameters is game-specific

◆ HandleInputDeviceConnectionChange()

void UGameInstance::HandleInputDeviceConnectionChange ( EInputDeviceConnectionState  NewConnectionState,
FPlatformUserId  PlatformUserId,
FInputDeviceId  InputDeviceId 
)
virtual

Callback for handling an Input Device's connection state change.

Parameters
NewConnectionStateThe new connection state of this device
FPlatformUserIdThe User ID whose input device has changed
FInputDeviceIdThe Input Device ID that has changed connection
See also
IPlatformInputDeviceMapper

◆ HandleInputDevicePairingChange()

void UGameInstance::HandleInputDevicePairingChange ( FInputDeviceId  InputDeviceId,
FPlatformUserId  NewUserPlatformId,
FPlatformUserId  OldUserPlatformId 
)
virtual

Callback for handling an Input Device pairing change.

Parameters
FInputDeviceIdInput device ID
FPlatformUserIdThe NewUserPlatformId
FPlatformUserIdThe OldUserPlatformId
See also
IPlatformInputDeviceMapper

◆ HandleNetworkError()

ENGINE_API void UGameInstance::HandleNetworkError ( ENetworkFailure::Type  FailureType,
bool  bIsServer 
)

Opportunity for blueprints to handle network errors.

◆ HandleOpenCommand()

bool UGameInstance::HandleOpenCommand ( const TCHAR Cmd,
FOutputDevice Ar,
UWorld InWorld 
)
protectedvirtual

◆ HandleReconnectCommand()

bool UGameInstance::HandleReconnectCommand ( const TCHAR Cmd,
FOutputDevice Ar,
UWorld InWorld 
)
protectedvirtual

◆ HandleTravelCommand()

bool UGameInstance::HandleTravelCommand ( const TCHAR Cmd,
FOutputDevice Ar,
UWorld InWorld 
)
protectedvirtual

◆ HandleTravelError()

ENGINE_API void UGameInstance::HandleTravelError ( ETravelFailure::Type  FailureType)

Opportunity for blueprints to handle travel errors.

◆ Init()

void UGameInstance::Init ( )
virtual

virtual function to allow custom GameInstances an opportunity to set up what it needs

◆ InitializeForMinimalNetRPC()

void UGameInstance::InitializeForMinimalNetRPC ( const FName  InPackageName)

◆ InitializeStandalone()

void UGameInstance::InitializeStandalone ( const FName  InWorldName = NAME_None,
UPackage InWorldPackage = nullptr 
)

◆ IsDedicatedServerInstance()

bool UGameInstance::IsDedicatedServerInstance ( ) const

Returns true if this instance is for a dedicated server world

◆ IsReplayDeferred()

bool UGameInstance::IsReplayDeferred ( const FString &  ReplayName) const
virtual

If given replay playback was deferred and has not started playback yet, this will return true.

Parameters
ReplayNameName of the replay file.
Returns
True if replay playback was deferred

◆ JoinSession() [1/2]

virtual bool UGameInstance::JoinSession ( ULocalPlayer LocalPlayer,
const FOnlineSessionSearchResult SearchResult 
)
inlinevirtual

◆ JoinSession() [2/2]

virtual bool UGameInstance::JoinSession ( ULocalPlayer LocalPlayer,
int32  SessionIndexInSearchResults 
)
inlinevirtual

◆ LoadComplete()

virtual void UGameInstance::LoadComplete ( const float  LoadTime,
const FString &  MapName 
)
inlinevirtual

◆ ModifyClientTravelLevelURL()

virtual void UGameInstance::ModifyClientTravelLevelURL ( FString &  LevelName)
inlinevirtual

Game instance has an opportunity to modify the level name before the client starts travel

◆ NotifyPreClientTravel()

void UGameInstance::NotifyPreClientTravel ( const FString &  PendingURL,
ETravelType  TravelType,
bool  bIsSeamlessTravel 
)

Broadcast a notification that travel is occurring

◆ OnConsoleInput()

void UGameInstance::OnConsoleInput ( const FString &  Command)
protected

Delegate for handling external console commands

◆ OnNotifyPreClientTravel()

FOnPreClientTravel & UGameInstance::OnNotifyPreClientTravel ( )
inline
Returns
delegate fired when client travel occurs

◆ OnPlayTogetherEventReceived()

ENGINE_API void UGameInstance::OnPlayTogetherEventReceived ( int32  UserIndex,
const TArray< const FUniqueNetId & > &  UserList 
)
protected

Delegate for handling PS4 play together system events

◆ OnSeamlessTravelDuringReplay()

virtual void UGameInstance::OnSeamlessTravelDuringReplay ( )
inlinevirtual

This gets called when the player scrubs in a replay to a different level

◆ OnStart()

void UGameInstance::OnStart ( )
protectedvirtual

Called when the game instance is started either normally or through PIE.

◆ OnWorldChanged()

void UGameInstance::OnWorldChanged ( UWorld OldWorld,
UWorld NewWorld 
)
virtual

Callback from the world context when the world changes, this ensure the world context is set properly

◆ OverrideGameModeClass()

TSubclassOf< AGameModeBase > UGameInstance::OverrideGameModeClass ( TSubclassOf< AGameModeBase >  GameModeClass,
const FString &  MapName,
const FString &  Options,
const FString &  Portal 
) const
virtual

Return the game mode subclass to use for a given map, options, and portal. By default return passed in one

◆ OverrideIrisReplicationSystemConfig()

virtual void UGameInstance::OverrideIrisReplicationSystemConfig ( FNetDriverReplicationSystemConfig OutConfig,
bool  bIsServer 
) const
inlinevirtual

Allows a GameInstance to override the default configuration of the Iris replication system. For instance if specific game modes require different settings.

◆ PlayReplay()

bool UGameInstance::PlayReplay ( const FString &  InName,
UWorld WorldOverride = nullptr,
const TArray< FString > &  AdditionalOptions = TArray<FString>() 
)
virtual

Start playing back a previously recorded replay.

Parameters
InNameName of the replay file.
WorldOverrideWorld in which the replay will be played. Passing null will cause the current world to be used.
AdditionalOptionsAdditional options that can be read by derived game instances, or the Demo Net Driver.
Returns
True if the replay began successfully.

◆ PlayReplayPlaylist()

bool UGameInstance::PlayReplayPlaylist ( const struct FReplayPlaylistParams PlaylistParams)

Start playing back a playlist of previously recorded replays.

Using "ExitAfterReplay" on the command line will cause the system to exit after the last replay has been played.

Using the "Demo.Loop" CVar will cause the entire replay playlist to loop.

Returns
True if the first replay began successfully.

◆ PreloadContentForURL()

void UGameInstance::PreloadContentForURL ( FURL  InURL)
virtual

Call to preload any content before loading a map URL, used during seamless travel as well as map loading

◆ ReceivedNetworkEncryptionAck()

void UGameInstance::ReceivedNetworkEncryptionAck ( const FOnEncryptionKeyResponse Delegate)
virtual

Called when a client receives the EncryptionAck control message from the server, will generally enable encryption.

◆ ReceivedNetworkEncryptionFailure()

EEncryptionFailureAction UGameInstance::ReceivedNetworkEncryptionFailure ( UNetConnection Connection)
virtual

Called when a connecting client fails to setup encryption

◆ ReceivedNetworkEncryptionToken()

void UGameInstance::ReceivedNetworkEncryptionToken ( const FString &  EncryptionToken,
const FOnEncryptionKeyResponse Delegate 
)
virtual

Handle setting up encryption keys. Games that override this MUST call the delegate when their own (possibly async) processing is complete.

◆ ReceiveInit()

ENGINE_API void UGameInstance::ReceiveInit ( )

Opportunity for blueprints to handle the game instance being initialized.

◆ ReceiveShutdown()

ENGINE_API void UGameInstance::ReceiveShutdown ( )

Opportunity for blueprints to handle the game instance being shutdown.

◆ RegisterReferencedObject()

void UGameInstance::RegisterReferencedObject ( UObject ObjectToReference)
virtual

Registers an object to keep alive as long as this game instance is alive

◆ RemoveLocalPlayer()

bool UGameInstance::RemoveLocalPlayer ( ULocalPlayer ExistingPlayer)
virtual

Removes a player.

Parameters
Player- The player to remove.
Returns
whether the player was successfully removed. Removal is not allowed while connected to a server.

◆ ReturnToMainMenu()

void UGameInstance::ReturnToMainMenu ( )
virtual

Calls HandleDisconnect on either the OnlineSession if it exists or the engine, to cause a travel back to the default map. The instance must have a world.

◆ SetPersistentTravelURL()

void UGameInstance::SetPersistentTravelURL ( FURL  InURL)
virtual

Call to modify the saved url that will be used as a base for future map travels

◆ Shutdown()

void UGameInstance::Shutdown ( )
virtual

virtual function to allow custom GameInstances an opportunity to do cleanup when shutting down

◆ StartGameInstance()

void UGameInstance::StartGameInstance ( )
virtual

Starts the GameInstance state machine running

◆ StartRecordingReplay()

void UGameInstance::StartRecordingReplay ( const FString &  InName,
const FString &  FriendlyName,
const TArray< FString > &  AdditionalOptions = TArray<FString>(),
TSharedPtr< IAnalyticsProvider AnalyticsProvider = nullptr 
)
virtual

Start recording a replay with the given custom name and friendly name.

Parameters
InNameIf not empty, the unique name to use as an identifier for the replay. If empty, a name will be automatically generated by the replay streamer implementation.
FriendlyNameAn optional (may be empty) descriptive name for the replay. Does not have to be unique.
AdditionalOptionsAdditional URL options to append to the URL that will be processed by the replay net driver. Will usually remain empty.
AnalyticsProviderOptional pointer to an analytics provider which will also be passed to the replay streamer if set

◆ StopRecordingReplay()

void UGameInstance::StopRecordingReplay ( )
virtual

Stop recording a replay if one is currently in progress

◆ UnregisterReferencedObject()

void UGameInstance::UnregisterReferencedObject ( UObject ObjectToReference)
virtual

Remove a referenced object, this will allow it to GC out

Member Data Documentation

◆ LatentActionManager

FLatentActionManager* UGameInstance::LatentActionManager

◆ LocalPlayers

TArray<TObjectPtr<ULocalPlayer> > UGameInstance::LocalPlayers
protected

List of locally participating players in this game instance

◆ NotifyPreClientTravelDelegates

FOnPreClientTravel UGameInstance::NotifyPreClientTravelDelegates
protected

Listeners to PreClientTravel call

◆ OnInputDeviceConnectionChange

FOnUserInputDeviceConnectionChange UGameInstance::OnInputDeviceConnectionChange

Callback for when an input device connection state has changed (a new gamepad was connected or disconnected)

◆ OnlineSession

TObjectPtr<class UOnlineSession> UGameInstance::OnlineSession
protected

Class to manage online services

◆ OnLocalPlayerAddedEvent

FOnLocalPlayerEvent UGameInstance::OnLocalPlayerAddedEvent

Local player access

◆ OnLocalPlayerRemovedEvent

FOnLocalPlayerEvent UGameInstance::OnLocalPlayerRemovedEvent

◆ OnPawnControllerChangedDelegates

FOnPawnControllerChanged UGameInstance::OnPawnControllerChangedDelegates
protected

gets triggered shortly after a pawn's controller is set. Most of the time it signals that the Controller has changed but in edge cases (like during replication) it might end up broadcasting the same pawn-controller pair more than once

◆ OnPlayTogetherEventReceivedDelegateHandle

FDelegateHandle UGameInstance::OnPlayTogetherEventReceivedDelegateHandle
protected

Handle for delegate for handling PS4 play together system events

◆ OnUserInputDevicePairingChange

FOnUserInputDevicePairingChange UGameInstance::OnUserInputDevicePairingChange

Callback when an input device has changed pairings (the owning platform user has changed for that device)

◆ PIEMapName

FString UGameInstance::PIEMapName

◆ ReferencedObjects

TArray<TObjectPtr<UObject> > UGameInstance::ReferencedObjects
protected

List of objects that are being kept alive by this game instance. Stored as array for fast iteration, should not be modified every frame

◆ TimerManager

FTimerManager* UGameInstance::TimerManager

◆ WorldContext

struct FWorldContext* UGameInstance::WorldContext
protected

The documentation for this class was generated from the following files: