When to use Server RPCs?


I was simply wondering when I should use server RPCs. Also, in one of my functions I’m checking if the role of the actor that is executing the function is equal to ROLE_Authority, and only run functionality if this is true. So what’s the difference in checking if the role == ROLE_Authority inside of the function rather than executing the function on the server (UFUNCTION with specifiers “Server”, “Reliable” and “WithValidation”)?

Another quick question… What is the difference between a function being called on something, rather than being executed? For example, a client RPC will be called on the server, and executed on the client.

Thanks in advance! :slight_smile:


On 2nd question:

Called - where function is called
Executed - where function code is actually executed

So if it’s executed in client, the code is run on client CPU. While call only triggers that execution via RPC

check this guide. very helpful. link text

So basically, if called on the server and executed on client, means that the server tells the client that it should run the code?


Yeah, I’ve already read through it all. This .pdf is actually where my question originates from :3
But yes, I agree, very helpful! Anyways, I think I understand how this called and executed works now. Thanks!