Multiplayer and skin

Hello,
First, I am sorry for my mistakes but I don’t speak english perfectly.
I am doing a multiplayer game.
I am using a blueprint named “bp_player” for both players. The problem is that they have the same skin… and I would like to begin the game with a menu where they choose their skin…

So, I have tryed something :

  • in my test_map, where the player spawn at the beginning of the game, i added a widget with 2 buttons to choose player among 2 skins. If you press a button then your skin change and become the skin you would like to have. It was working, BUT the problem is that only the player see the correct skin (the other player see the basic skin and not the skin that the player 1 have chosen).
    Example : I have two skins named Akai and Paladin. Basic skin is Akai. If player 1 choose Akai and player 2 choose Paladin, then Player 1 will see all players with akai and player 2 will see him with Paladin and player 1 with akai (what they asked for).

How can I do to change my skin and make all player display the correct skin ?

Thank you for your answers !

Have a good day

Networked multiplayer game. But it change nothing because when i begin the project i was with both player on the same computer and i wasn’t able to change skin either… :confused:
But at the moment i am in a networked multiplayer game

This is where i change my skin :
https://image.noelshack.com/fichiers/2018/36/4/1536244259-capture-d-ecran-7.png

In my widget you have 2 buttons to choose your skin. I change the skin and the animBP

In fact, when you are in multiplayer networked game, all player think they are player 0. (It is what i read)
For example client 1 think he is player 0 and think that client 2 is player 1.
Client 2 think he is player 0 and think that client 1 is player 1.
It is the reason why i can’t use the player index :confused:

Is this a problem over a networked multiplayer game or are both players on the same computer?

OKay. Can you show us the code where you are trying to change the skin? Maybe you have the right idea and just need a small adjustment.

I see in your blueprint screenshot where you have the buttons change the skin for player 0.
where do you change the skin for the other player?

I think we figured this out in another post, right?

This is a replication issue for sure. Has this been solved for you? Or have you been refered to another post?

Where the event takes place that you change skins, you can add some custom events to fire it off.
For example:

One custom event called “MulticastChangeSkin” set to Multicast and checked reliable, firing off your string of code that changes the skin.

Then another custom event called “ServerChangeSkin” set to Run On Server and checked reliable, firing off the MulticastChangeSkin custom event.

Wherever you want this skin-change to occur, say you press the letter ‘S’ to change skins, have that keybind go into ServerChangeSkin.

So if you were to see them in order it would be like:

‘S’ Keybind>ServerChangeSkin>MulticastChangeSkin
MulticastChangeSkin>string of events that actually changes your characters skin.

That way it would be replicated and all players would see the change.

What’s happening to you is that the Server sees the changes, whichever player is hosting the match. But the clients connected, your other player for example, don’t see the change as the server isn’t sending that information to them.

Hope this helps, if you want pictures let me know. :slight_smile:

1 Like

hi samohickey,

what if i would like to change the player skin (2 Player Start) on Beginplay … the server player should get skin 1 and the client should get skin 2 ? I m not getting it right now, if you could show a pic maybe it would be more clear how to achieve this to work.

Skin changes “Have to take place on the server”.

Use a Rep Notify variable for the skin ID… skeletal meshes do not replicate.
Set the rep notify variable on the server. The onRep function will execute. This is where you take the skin id from the rep notify var and change the skin.

The engines replication system will replicate the rep notify variable to all players. When they receive it, they will execute the onrep function, thus change the skin.

Here’s a demo walkthrough I did a few months back for another post. It should answer all your questions and firmly define what rep_notify is.

1 Like