Dynamic Material Replication

I am trying to make the player take on NPC color by getting its dynamic material color. However, this only works for the server but not the client. Client will always see the other player as the default color (black).

21239-ue402.png

Any help would be greatly appreciated! Thank you for your time.

  • Jeff

I solved this with the following approach: Assume i want to turn on the lamp on a player car. Other players should see this too, right?
Lets assume the following scenario. Client/Server game with cars as pawns and the players controlling them.
Player input goes thru the PlayerController. PlayerController controls the respective pawn (for steering, and the lights in this case).

So my chain of events would be like this:

 - Input by driver A (Player Controller, client side)
 - Send custom event to server side of PlayerController A
 - Player Controller Server calls custom event on Player Pawn (the actual car) with replication Multicast
 - Player Pawn does the material change. Since this is visual, the clients have to do this, and for all relevant instances.

Here are the screenshots of my simple test setup:

The player controller, in it’s simplest form. The input handler left, the serverside handling to the right.

The player pawn. Here’s the event that the player controller (serverside) calls on all instances of this pawn. “All instances” meaning all instances of that pawn associated with the player controller doing the action.

Oh yeah, one more thing: In regards to replication of material instances etc - not required. The only things i replicate are those the server is supposed to have authority over. But in the case of these visuals it’s not really necessary.