Hi there,
This is my first question about networking. The idea is after client connecting to server, it calls a “login” function on server and server sends back avatar information.
From client site, after connection, it sends the following RPC request:
function OnConnectedToServer() { networkView.RPC("ClientLogin",RPCMode.Server,playerName,playerAvatarId);
}
On server side, the RPC function is defined as:
@RPC
function ClientLogin (playername : String, avatarid: int)
{
var modelname : String = "playerPrefab";
var pos : Vector3 = Vector3(0,0,0);
//networkView.RPC("Spawn", info.sender, modelname, pos);
print(playername + " logged in with avatar " + avatarid);
}
The function “ClientLogin” never get called, and I got these errors(on server side):
View ID SceneID: 2 Level Prefix:0 not found during lookup. Strange behaviour may occur
Do I need to setup networkView id for client/server communication? Or I have to use Network.Instantiate?
Which means the RPC funtion doesn’t function by itself, it must adhere to a GameObject instantiated over the network?
Need your advice, thanks!