I’ve started working persistently on my project game and it seems that writing RPC functions creates a lot of extra code and functions. I am wondering if this is right or am I doing something wrong. So far in my character I have 3 things that needs replication. Health, Sprinting and Changing the speed of the player.
So i have 4 functions to replicate the health (SetHealth and ServerSetHealth() + Validation and Implementation). 4 more to change the bool bIsSprinting and 4 more to set the speed of the character when key is pressed. That resulted in 4 * 3 = 12 functions. They are not complex or anything but as far as I know, when a function is called it takes a memory. So if I build a lot of functions wouldn’t that result in a lot of memory taking? Or am I doing something wrong?
I’ve been thinking on improving a little bit the bool and speed of the char like, whenever I set the bool in the RPC function, I set the speed as well -> solving two problems with one function hehe. But is it ok for the code?