WTF 2 weeks and one problem

Hello!

How to fix that? In my opinion that should work but doesnt work :confused:
The Players on client should show value β€œ1”.

Please help me :frowning:



SHU_BdqR9O.jpg

I’m a multiplayer noob myself, but here’s what I would try:

Make TextRed a RepNotify. On the On_RepNotify function, call Update Game Start. This will ensure the client runs this event locally. Let me know if this works.

Cheers!

Thank you for answer but it unfortunately doesn’t work :confused: Maybe you have another idea? You are my last hope :frowning:
Please help me :frowning: it’s very important to me to fix that

SHU_yoWMlg.jpg

SHU_qYV2Xe.png

I’m just figuring out replication myself as well but you need to replicate the custom event not necessarily the parameters. So your OnClickedRedTeam, probably needs to be set to replicate as well and your OnGameStart should probably also run on the server not on the client. Also make sure you check Reliable and it should solve your problem. Reliable means that it’s an important event that the engine cannot skip.

When you GetPlayerController on the server you get the Server PlayerController and when you do it on the client you get the Client PlayerController.
The Client will never be able to read anything from the Server PlayerController since PlayerControllers are only replicated to the owner.

Information about the game state that you want to allow all players to read could be saved in the GameState class instead since this is replicated to all clients.

  • Widget

    • (client-side) Widget gets the local client button click and Calls RunOnServer event on the PlayerController

  • PlayerController

    • (server-side) The PlayerController calls an event named JoinRedTeam on the GameState

  • GameState

    • (server-side) JoinRedTeam sets a RepNotify Variable and calls UpdateGameStart if ListenServer.

    • (client-side) RepNotify calls UpdateGameStart

Note that the RepNotify function is not called on the server itself it is only called on the clients receiving the update. This means that a listenServer has to call UpdateGameStart outside of the RepNotify function.

Hope that helps.

Thanks! It works!!! THANK YOU!