My problem is that when I wrote the code (and I run the engine through Visual studio, as I remember it solves most of the problems with compilation). And ran the project to check the display of messages “Server: OnRep_ReplicatedVar” and “Client %d: OnRep_ReplicatedVar”. code below:
But as you can see it doesn’t display information about the client. I didn’t get any errors from the engine.
When I connected the OnRep_ReplicatedVar function in Level Blueprint, it displays only information about the server. But there is no information about the client. I decided in the code to swap the message about the server and the client. It shows information about the client only ID shows 0, even with three clients. I changed MyBox.cpp file from GitHub, but everything is the same. Deleted temporary files. But GPT-chat suggested that in the function if (HasAuthority()) is always true and that’s why it always shows messages about the server. I decided to go through the code through debug, and I didn’t even go down to else debug. In the if() condition you could specify that HasAuthority() try/false, so that there would be an explicit overlap (I think so). But I don’t know how to do it yet! But alas while the problem I have such an inscription for different clients is not displayed, but everything else works fine.