Hey,
I’m using Unity-2022-3-LTS.10f1 and Netcode-for-GameObjects 1.6
All I’m trying to do is make a client call a ServerRpc that makes the server(in this case the host) Debug.Log its name (the host’s player name) but it when i call this on the client it the server Debug.Logs the clients name.
before anyone asks yes, this script is on a NetworkBehavior object
why?
Code:
//this is in an update loop
if (Input.GetKeyDown(KeyCode.P))
{
TempServerRpc();
}
[ServerRpc]
public void TempServerRpc()
{
Debug.Log("server");
Debug.Log(transform.name);
}