Show old player updates to new player on login

hi,
i working on multiplayer vr game , and i need a solution for this issue : -
i have a widget in my game which will be visible to all the player and i want all the updates in my widget to be visible to the newly join player on login.

suppose there is a player on server and that player do some changes inside the widget and then after sometime another player join the server but widget update from first player is not visible to this second player .

any suggestions or solution would be highly appreciated.
i wasted lot of my time on this .

Store the data for the widget on the game state, as the game state replicates to all players. If you need to store all the changes and not just the current state, capture the changes in an array on the game state and play them back to the connecting user on BeginPlay.

thank you @MattG_ZeroFill ,
i did try that but it didn’t worked for me then i store data to player controller which worked for me but for this widget thing i am stuck there
let me explain about my widget


this is my widget and left panel in this is inside wrapbox
and in game player needs to clear left panel, then select topics from right panel and add to the left panel
like this

in this selected topics from right will be assigned in left on clicked to blank thumbnail
and there will be more then 50 topic so what will be the correct way to store it in game state

You should probably store your variables on a server event on the player controller and also inside the same server event cast to your player state and set those variables there also. You’ll need to create the same variables in the player state to set them there. Make them instance editable and mark them to “replicated” you can use your game instance to create a function that runs a “For Each Loop” using “Get Game State” > “Player Array”> into the For Each Loop.

Pulling off the array element cast to your correct player state and retrieve those variables off from the “As Your Player State”. This will be where you stored them on the server event and create your widget elements respective to those variables. Add them to the widget you created that holds all the images and information. At the tail end of the function just use a short delay and plug it back into the beginning of the function in the game instance and it will update after the delay for each player that comes in or leaves.

You will need to remove these widgets from parent each time the function executes using “IsValid?” and if is valid, remove from parent and recreate the widget that is the holder of the information and if it is not valid just simply create the widget, run the For Each Loop again and add the variables and images to the boxes you created in the first widget.

Just make vertical or horizontal boxes and set them to “IsVariable” inside the widget editor so you can retrieve them from your widget reference in the game instance. You can put a branch in the beginning of this function to cease its operation from continuously running by an outside boolean.

2 Likes

@Humanasset wow , thank you so much for such detailed explanation
i was already doing the same thing but it wasn’t working then after your explanation i come to one conclusion that i need to recreate the widget every time a new player joins with all the updated values and it worked for me so far .
thank you for your time and help ,means a lot

1 Like