A question about Unet RPCs/Commands

I have used commands and RPCs, but I have a question about them. Say I have a player object, that’s a client and not a host, and In a player script that’s on this object I have this code.

void Start()
{
    CmdQuestion();
}
[Command]
void CmdQuestion()
{
    RpcQuestion()
}
[ClientRPC]
void RpcQuestion()
{
      print(transform.name);
}

Would this code print the object that had the script on it’s name, or all clients names?

This would print on all clients (but not on a standalone server if you happened to be using a standalone server and not a “host”).

But what objects name would it print? The one that called cmdquestion or all players because of the rpc?

Code inside Commands runs on the server. Code run in an RPC on the server executes on every instance of that object in every client.

The code you wrote above basically says

“Hey me with Local Authority, tell the server version of me to do this thing on all versions of me on all client instances of me”

Alright thanks so much :slight_smile: