UGantryExperienceStage_LocalPlayers
Base class for a stage that does something for every local player while its experience is active, including split-screen players who join later.
The stage works for the players there when it starts and for every player who joins after. It stops for a player who leaves, and for everyone when the experience ends. Use it for anything that belongs to each player rather than to the world: input mappings, a HUD, a per-player setting.
In Blueprint
Make a Blueprint subclass. Implement On Local Player Added to do the work for one player, and On Local Player Removed to undo it. The stage starts for players as soon as it begins.
In C++
Override AddToPlayer and RemoveFromPlayer. A stage that has to prepare something first, such as loading assets, overrides BeginStage and calls StartForLocalPlayers when it is ready.
The stage is Client Only by default, since a dedicated server has no local players.
- Inherits
UGantryExperienceStage
Functions
GetLocalPlayers
| Pin | Type | Direction | Description |
|---|---|---|---|
| Return Value | TArray<ULocalPlayer*> | out | The local players the stage is working for. |
K2_OnLocalPlayerAdded
A local player to work for: one there when the stage began, or one who joined since.
| Pin | Type | Direction | Description |
|---|---|---|---|
Player | ULocalPlayer* | in | The player. |
K2_OnLocalPlayerRemoved
A local player to stop working for: the player left, or the experience is ending.
| Pin | Type | Direction | Description |
|---|---|---|---|
Player | ULocalPlayer* | in | The player. |
C++
Public C++ members that Blueprint does not see.
UGantryExperienceStage_LocalPlayers
Sets Net Execution to Client Only.
BeginStage
virtual void
Starts for every local player and finishes; subclasses that prepare something first override it.
EndStage
virtual void
Stops for every player it started for.