Navigation
API > API/Plugins > API/Plugins/ModularViewports
Instantiates a given World within a new Game Instance. Destroying this object will shut down and destroy both. Works across both PIE and non-editor. Use for spatially discontiguous picture-in-picture, second window content, or other multi-tenant scenarios.
Produces a "headless" world. To create players, you must first associate it with a viewport-client. To spawn player-controllers, you must first associate it with a viewport.
Note: BeginPlay is called immediately, before any players exist. This is different from the primary game instance's standalone behavior (but will be familiar to anyone who has developed multiplayer games). Actors in the world will find that the Player Controller doesn't exist yet on Begin Play. Getting the Player Controller on BeginPlay is an anti-practice anyhow. If you put input-binding code in the Player Controller (where it belongs) and use proper abstractions + event-driven orchestration, this will not be a problem.
Does NOT support:
- In-editor but NOT from-PIE (i.e. from custom editor tools)
- Networking/replication
- Travel
- Multiple instances of the same world asset
| Name | FAuxiliaryGameInstance |
| Type | class |
| Header File | /Engine/Plugins/Runtime/ModularViewports/Source/ModularViewports/Public/Engine/AuxiliaryGameInstance.h |
| Include Path | #include "Engine/AuxiliaryGameInstance.h" |
Syntax
class FAuxiliaryGameInstance : public FNoncopyable
Inheritance Hierarchy
- FNoncopyable → FAuxiliaryGameInstance
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FAuxiliaryGameInstance
(
UGameInstance& |
Engine/AuxiliaryGameInstance.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FAuxiliaryGameInstance() |
Engine/AuxiliaryGameInstance.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| EndPIEHandle | FDelegateHandle | Engine/AuxiliaryGameInstance.h | ||
| GameInstance | TStrongObjectPtr< UGameInstance > | Engine/AuxiliaryGameInstance.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UGameInstance * GetGameInstance() |
Engine/AuxiliaryGameInstance.h | ||
UWorld * GetWorld() |
Engine/AuxiliaryGameInstance.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FAuxiliaryGameInstance * Make
(
const TSoftObjectPtr< UWorld >& Asset |
Engine/AuxiliaryGameInstance.h | ||
static TSharedPtr< FAuxiliaryGameInstance > MakeShared
(
const TSoftObjectPtr< UWorld >& Asset |
Engine/AuxiliaryGameInstance.h | ||
static TUniquePtr< FAuxiliaryGameInstance > MakeUnique
(
const TSoftObjectPtr< UWorld >& Asset |
Engine/AuxiliaryGameInstance.h |