I’m making a multiplayer board game in Unreal Engine using Blueprints.
I have a color assignment system for players.
Setup:
* GameMode stores an array of available colors:
Red, Blue, Green, Purple.
* When the match starts, each PlayerController calls a `ChooseColor` Server RPC.
* Server picks a random color from `AvailableColors`.
* The selected color is assigned to the player’s `BP_PlayerState.PlayerColor`.
* After assignment, the used color is removed from the array (`Remove Index`) to avoid duplicates.
`PlayerColor` is an Enum variable inside `BP_PlayerState`.
Settings:
* `PlayerColor` → RepNotify enabled.
* `BP_PlayerState` is assigned in GameMode’s `Player State Class`.
Problem:
The server seems to assign colors correctly.
Example logs:
Server:
Player1 = Purple
Player2 = Red
However, clients receive incorrect replicated results:
Client1 = Purple
Client2 = Purple
So the server shows different colors, but clients see the same color.
Current logic inside PlayerController:
ChooseColor (Run on Server)
→ Get GameMode
→ Cast to BP_GameMode
→ Get AvailableColors
→ Length > 0 check
→ Random Integer In Range
→ Get(Array)
→ Get PlayerState
→ Cast to BP_PlayerState
→ Set PlayerColor
→ Remove Index from AvailableColors
Current logic inside GameMode:
Current logic inside PlayerState(OnRep_PlayerColor):
Questions:
* Is my architecture correct for multiplayer color assignment?
* What’s the proper way to store and replicate unique player colors using PlayerState?
* What is the safest way to reference the correct PlayerState in PlayerController / UI / Character Blueprints?
I can also provide Blueprint screenshots if needed.
Sorry if my bluprint is too bad, I just started learning it recently