Make other team health Bar a different color

I’m trying to make a simple Multiplayer Team death match game and I want the one team to have a green color overhead health bar and the opposing team to have a red health bar.

I select my team alignment at the star of the game and spawn my players.
But for client 1 (Red team) he sees a red health bar on the 2nd player who is on the green team,
and client 2 (Green team) doesn’t see any health bar on the 1st player.

I want the red team to have a red health bar and the green team to have a green health bar.

Game

Event to change the players color.

Call change color on widget depending on team selected

Generally you should not involve server so authority over UI stuff because it’s just waste of bandwidth, server should only replicate game state and events that is needed and client should formulate UI locally based on that data. So you should inform client on which team they are and then client should set the color based on that.

State is most impotent thing security wise, as potential hacker will hack UI regardless and they can determent team state by reading data from UI, so it’s pointless to do any server authoritative actions over UI.

1 Like