Widget Component Replication

Hey!

I’m making a multiplayer lobby system where each player’s character have a Widget on top of their heads that contains their name, pfp and wether they are ready or not.

This is the Blueprint of the Event Begin play of each actor. “Widget” is a widget component, and “Component Replicates” is ticked.

When I try this, each player sees its own Widget on top of every other character’s head.

Does someone have the kindness and time to point out my mistake? I can’t figure it out x(

Thank you for reading, have a great day!

Loïc

GetPlayerController(0) will always be the local player controller. So for each client it will be different, but for each player character (on one client) it will be the same.

You probably want to have a look at player states or similar.

A very good source for replication in unreal is the Multiplayer Network Compendium by Cedric Neukirchen.

1 Like

Do not replicate components. Replicate values from base types (enum, float, int, bool etc.)

Create a PlayerName variable in the player state.
Set the variable as Rep Notify. This will create a OnRep PlayerName function.
In the function you update your Widgets Player name text w/the Player Name value.

Set the PlayerName variable on the Server.

1 Like

Hello,

Thank you so much ! It really helped me ^^

Have a great day!

Hello,

Ok, thank you very much, it helped me ^^

Have a great day !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.