- The character has an Energy variable;
- Everytime it moves (AxisInput MoveForward, MoveRight, MoveUp) this energy will be consumed (decreased).
- Currently, when energy is consumed, we call the “ConsumeEnergy(float Value)”(Server RPC) method. So, when it’s a client, we’ll call as RPC.
- The server can’t follow the number of updates from AxisInput tick rate, resulting that the client-character will have it’s energy reduced slower than the server-character (cause the server won’t need a RPC to consume energy).
How to properly synch with the server a variable that updates every tick? Also, the updated value must be used to check if the player has energy to move, so at the same time we update the value, we must received the correctly updated value.