I am trying to use the new features in 5.2 that allow for client authority spawning. I am getting some errors on the client that I can’t figure out.
Here is the function
public void makeBoosterItem (Vector3 pos, float temp, int biome){
float Level = Vector3.Distance (pos, spawnPoint);
GameObject Hr = Instantiate (healthRoot) as GameObject;
Hr.transform.position = pos;
Hr.GetComponent<Item> ().setNetworkOwner (player);
Hr.GetComponent<Item> ().setLevel (Level);
NetworkServer.SpawnWithClientAuthority (Hr,player);
}
Now I garentee you that the player is the correct player. I have checked the network owner varible in my other script and it is the correct game object. However whenever I log on as the client I get this error
SpawnWithClientAuthority Player object is not a Player. Its referring to the last line of that function. I don’t understand. I am giving it a player object. It works on the server fine. Does anyone know more about the restrictions involved when using SpawnWithClientAuthority? does it have to be used from the player object? I can’t find the documentation on the function.