Common Practice for Client-Triggered Events?
Hi, I am wondering if I should run functions that define some sort of client-triggered behavior only on the server and then as a multicast, or if I should immediately run it on the client that caused this event as well.
So, to my knowledge there are basically 2 ways to deal with client-input: have the client call a server function and then, if other clients need to know about any changes, either set replicated variables or call a multicast-function.
My question is: should I wait for the multicast function (or replicated variable) to arrive on the "original" client? Or should I call the multicast function (or set the variable...) on that client right away to avoid an unnecessary delay? If so, wouldn't that cause problems when the update from the server arrives at the client, basically triggering the same response again?
As an example:
I have a function...
Is it better to have the client call "StartAttackAnimation" (or alternatively "InitiateAttack_Multi") inside "InitiateAttack" when the message to the server is getting sent or wait until the multicast-call gets back?
Well I'm not sure if this is common practice or not, but the way I'm currently doing it (and the way I've seen others do it) is pretty much like you said, except with one addition:
So in my case I was doing tracer fire, which I want no lag on:
answered Feb 19 '17 at 11:17 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here