Client not replicating

So i been trying to make a character selection screen and no matter what i do the client is not sending any information to the server so it ends up not updating at all,yes i am using RPCs and have all the right things “replicated”, i tried the same exact setup on a new project and it worked just fine so naturally i made a new project and migrated my files there incase it’s the the project settings (which i haven’t even changed) but still it didn’t work.

the workflow goes as following:

the widget sends the choice ID to the player controller

the controller switches the ID depending on what you pick, then when you get the confirm button in the widget (until here it works fine as it’s all local) then the controller sends the ID to the Server through the GameMode BP (that fails on the client - on the faulty version)
Screenshot 2024-07-11 112323
as you see i am using an RPC so even if the client doesn’t have access to change anything it should be able to send the info i need to the server

Screenshot 2024-07-11 112323

Then the Gamemode spawns the character with the information relied from each controller seperately (the character does spawn and is possessed by the right controller) but the ID fails to get through to it

then with that information the Character changes its mesh on beginplay
Screenshot 2024-07-11 112311

just to save some time for whoever will be generous enough to help
i did waste a lot of time trying the elimination process:

  • Controller:it’s not that i tried a different controller (and yes has replication on)
  • character:tried different Pawn BPs (and yes has replication on )
  • widget: i cant even see how it would be the problem but i still tried different widget BPs
  • Gamemode: tried that too
  • project: as mentioned in the start of the question

also i would like to add a note : it’s not just that which is not replicating from the client…everything the client does (except for movement) is not being sent to the server even with RPCs.

whoever out there who will have it in them to solve this issue will have my gratitude forever…i squeezed my brain for 72 hours straight to get this thing working and it was just a dead end.

made a mistake…thats the controller bp part
Screenshot 2024-07-11 112435

so you’re setting ID on the client not the server. “EventPick” i know its replicated but it only replicates server to client not client to server

on your server RPC Confirm, add an input which is ID and pass that through

!!! it worked!!! thank you so much!!! i can’t believe such a small detail would make me go in circles as such…i thought that the information would be relied from the client to the server if the chain started with an RPC…i see the error of my ways, but i am a little bit confused on why it worked with the same exact code on a new project?

it’ll work if the client is the server, ie player 1 or if EventPick was a ServerRPC too

might have been the case…well in any case i am thankful for your help you literally saved my project from collapsing!

1 Like

Alternative and generally better for Late joiners and re-joiners.

Use a RepNotify struct for cosmetics. Have the server set the struct. Use the OnRep Function to build out the cosmetic settings. This way the GM can use a base character to spawn. Then you can swap out skeletal mesh, materials (skins), actor components, abilities etc as needed.

1 Like

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