Change character color in multiplayer

Hi,

I have been following the networking tutorials (provided by Unreal) and when I run a server and a client with a third person character in each they are both blue. I have looked everywhere and cannot find an simple answer.

Is it possible to make one of the characters a different color via blue prints. I have seen multiplayer You Tube videos where there are four players all different colors.

Can someone please help I am getting very frustrated trying to figure out something that I presume is very simple.

Thank you,
Ben

Thanks Pixel Omen, this is the link I started with (watch from 5 mins). There is a fifth video in the series - the link is -

This video starts from the third person template which I followed…

Ok, so when you’re dealing with networking, things can get pretty complicated, but it’s not too bad. There’s actually 2 parts to this.

  1. The character’s color is based on its mesh component’s material, which is inside the Character blueprint.

  2. Both the server and client are using the same ThirdPersonCharacter blueprint, so in order for you to change the color of one of them, you need to have 1 of the “players” use a different character blueprint that has a different material on the mesh. In that tutorial, he’s not using a dedicated server, so by default, the server is Player 0 and the first client is Player 1.

To deal with both of these things, you’ll have to do the following:

  1. First you need to create a new character blueprint (you can just duplicate the template BP and give it a new name, like Character2_BP).

  2. Go into the mesh component of the new Character BP and assign it a new material with a different color (again, you can just duplicate the material and give it a new name and a new color).

  3. Place the Character2_BP somewhere in the level, wherever you want Player 1 (Client) to spawn.

  4. Use your level blueprint to get Player 1 to possess the Character2_BP on begin play. You can do that with a level bluperint that looks like this:

Then you should be good to go. There is of course more than 1 way to do this, but this is the easiest way I can think of. You could also set the material dynamically, but then you have to deal with replication and stuff, unless you set it on the client side I guess… anyway it can get complicated.

Thank you for your effort - it still wouldn’t work. So I have a couple more questions - sorry!! Do I need to delete the Player Start when I put the duplicated new Character in? And the reference you have to Default Actor - where do I get this from? Do I create a new variable or is it referenced to something else?

I was able to duplicate the blueprint but I just created a new Actor variable for ‘Default Actor’ and it doesn’t do anything.

Thank you very much for your patience and effort in helping with this
Ben

Take two. My controller possesses the new character. But I cannot move I can only look around and it still spawns another ‘blue’ person at Player start.

I’m getting there… thanks - just not sure where from here

Thanks PixelOmen I have got it to work. I had to change the Switch Has Authority to Remote and the Player Controller to 0 and it works fine.

Thank you SO much for all your help.

Hi. I wanna ask like how did you change the character color?
I can change them when all clients are at the same level, so whenever anyone changes their body color, all clients see that specific person changed.
However, when I tried implementing host/join session, client A changes color before client B enters. After client B joins the session, from client B’s view, the color for client A is the default color. How can I fix this? You can refer Among Us, like you can see other players already chose their colors when you joined the room late.

Hey @JsonYeo

this is an old thread but have a look at these projects:

UE426_MultiplayerTest.zip (2.3 MB)
UE427_MultiplayerTest.zip (2.3 MB)
UE50_MultiplayerTest.zip (2.4 MB)
UE51_MultiplayerTest.zip (1.2 MB)
UE52_MultiplayerTest.zip (549.8 KB)

If you still have questions, please create a new topic :slight_smile: