Who Has Authority? (Server Or Client) And When?

You can always test things. For example:

Is wrong:

Printing “Has Authority” on the player controller:
image
There are two prints from the server because the server has copies of both controllers, and they are both true because the server has authority on both. The client only has one print that’s false because it only has its own controller and does not have authority over it.

Printing “Has Authority” on the player character:
image
There are four prints because both the server and the client have copies of both characters. The server has authority over both its own character & the client’s character, whereas the client has authority over neither.

This is with three players (left is from player controller, right is from player character):
image

And this is on a dedicated server (left is controller, right is character):
image


From the documentation, it says:

The Switch Has Authority node is used to check if the script is being executed on a machine that has Network Authority (in most use cases, this would mean Server) or if its being executed on a remote machine (in most use cases, this would be the Client)."

I think the “in most cases” is referring to when the client spawns a replicated actor, which makes the client the authority; though, because the client spawned it, it won’t spawn for all players because the client is not the server. When spawning a replicated actor on the server, the actor spawns for all players, so in order to have a client spawn an object for all players, you need to have the client request the server to do so.


So the literal answer to the question “Who Has Authority?” is:

But the “in most cases” answer is:

In most use cases, this would mean Server

Because:

9 Likes