Small RPC Code Not Working

Hello Everyone

i’m in the process of learning networking and RPC’s

In The MultiPlayer[In Scene 1] Script I Use This Code

void OnPlayerConnected(NetworkPlayer networkPlayer)
	{
		networkView.RPC("TellPlayerServerName", networkPlayer, serverName);
		
}

and in other Script Called PlayerGetInfo[In Scene 2]

I Use This Code

	[RPC]
	void TellPlayerServerName(string servername){
		serverName = servername;
	}

i’m trying to send Server Name To The Player. but its not working.
i rly dont know why.

Probably because your serverName variable in the class has the same name as your parameter so it’s never being set.

Try

 this.serverName = serverName;