๐งพ Gorgeous Player State
Short Description
PlayerState subclass with AutoReplication data and stable player ID replication.
Long Description
AGorgeousPlayerState stores per-player Object Variables, supports AutoReplication RPCs, and replicates a stable player ID. It is replicated to all machines, making it a reliable source for per-player metadata.
๐ Features
- AutoReplication mixin and relay for per-player data.
- Stable player ID replication and rename flow.
- Player array events for UI or gameplay hooks.
๐ Usage Examples
AGorgeousPlayerState* PS = GetPlayerState<AGorgeousPlayerState>();
PS->SetGorgeousStablePlayerId(TEXT("LocalPlayer_0"));
Use On Gorgeous Stable Player Id Changed to refresh UI when the ID updates.
SetGorgeousStablePlayerId
Sets and replicates a stable player ID across the network.
| Parameter Name | Type | Description |
|---|---|---|
NewId |
FString |
New stable ID to assign. |
PS->SetGorgeousStablePlayerId(TEXT("Player_A"));
Best Practices
- Use PlayerState for data that every client should access.
- Prefer stable IDs for cross-session matching.
Troubleshooting
- If the stable ID is empty, verify the local player registry is active.