Hello and thank you for taking your time to help me.
I have a problem with a Blueprint Widget. I want to display on the players screen the number of players present in the session and the maximum number of players that the session can contain.
(1)
So I made a binding by getting the replicated variables from my Game Instance (called ‘Général’).
(2)
(3)
(4)
This works perfectly for the session host but not for the clients.
Host:
(5)
Clients:
(6)
PS: I checked that ‘Cast to Général’ did not fail in the client case.
I use the replies to add images because I can only put one image per post. Sorry for the discomfort of reading.
It seems you have problems replicating the variables on the client. There’s a guide on how to properly replicate the information from the server to the client in the official documentation. My guess is that perhaps you’re just missing something really simple.
Thank you for your answer.
I followed the procedure you recommended but it did not solve the problem. I went as far as downloading the sample projects provided by Epic Games but everything seems to be in order. I did find a few things though.
In the tutorial, they indicate that you have to check the ‘Replicates’ box for a TextRenderer. However, in the case of a Widget Blueprint no ‘Replicates’ box appears.
The variables are indeed defined as replicated in the Game Instance (1) but in the Widget Blueprint the variable is not listed as replicated. (2)
I have tried many ways to solve this problem, but I can’t find a solution. So I am attaching all the changes I made to the variables in question, hoping that you will find the problem.
(3) & (4)
Thanks in advance.
Game Instances cannot have replicated variables and have no network functionality. Blueprint lets you mark any property as replicated, but that doesn’t not mean it will actually replicate.
The ONLY classes that support replication in Blueprint are actors and their components, even then, there are rules about what actors replicate to whom. I’d suggest having a good study of the multiplayer sample projects and some of the community reading materials.
Also as a moderator note: please do not make seperate posts for every image, you can have multiple images in the same post.