Why does my variable doesnt get replicated from the server?
Hey guys, I am trying to set a variable (the characters speed) on all players, so the animations play correctly for them. On the server, the variable has the correct value for all players, but the clients dont even get their own variable right, even though the variable is set to be replicated and therefore should be set to the servers value on all clients, right?
I will give u the answer but you also need to listen to Nachtmahr, because I think you are missing a bit of knowledge about networking.
So what you are doing right now is you are getting the velocity from the client side and the sent it so the server so u are getting a value that is not correct(because as you said it yourself: the clients don't get theyre own variable right). So what u need to do is you need to do is connect the vectorlength straight to the variable of the server(so plug it in after the event "setspeedonsv") and remove the parameter on the event because you don't need that one. You can also remove the "setspeedoncls" event because the variable is replicated and it comes from the server the variable gets automatically set on everyone.
answered Aug 20 '17 at 12:09 PM
Should cover all your Networking Questions (guess thats better than giving a straight Solution). You could also Download the Content Examples Project from the Learn Tab it has a whole section dedicated to Newtworking if you need something to look at.
Good Luck mate =)
answered Aug 20 '17 at 06:23 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here