Hello!
How to fix that? In my opinion that should work but doesnt work
The Players on client should show value β1β.
Please help me
Hello!
How to fix that? In my opinion that should work but doesnt work
The Players on client should show value β1β.
Please help me
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 Maybe you have another idea? You are my last hope
Please help me itβs very important to me to fix that
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!