How To Get some player info from all clients, store it on the server, then give a copy to all clients?
I have some sort of a lobby set and I want the players to be able to call the GameMode which has a list of all Player Controllers connected where the GameMode can then get the player info (struct) from all the Player Controllers, put it in an array, then give it back to all players so they can display the info on the HUD
I tried everything I could think of but I can't get it to work, I only get the server's Player Controller info over and over again. I'm sure that the Connected Player Controllers Array is set right and working, Sure that the Player Info is also set up properly, working and replicated
if you can provide example code as well, that would be generous of you as I'm still a beginner in networking
The GameMode is going to only exist on the server. You can send information from the GameMode to all of the clients but clients wont be able to access the GameMode; unless they have a server side version of the class, such as a PlayerController.
If you want to replicate something to all clients from the GameMode, you can try something like:
Follow this question
Once you sign in you will be able to subscribe for any updates here