So i wrote a script to randomly spawn objects. I will be using it for trees and foliage but could be used for anything to be spawned randomly on a terrain. All is working fine on my local machine when i instantiate the object to the game.
Heres where i am having problems. I am trying to instantiate the tree to the server when it starts up on a Photon Server using this bit of code here.
Transform newObj = (Transform)PhotonNetwork.Instantiate (ObjList[ObjNum], hit.point, Quaternion.identity,0);
but i am getting this error and i dont know why.
you will see that i commented out line 156 to make it work. to instantiate to the local machine but i do need it to spawn the tree on the server.
and this means on line. 95, 47 and 156 have this issue is it is re-enabled…
Assets/RandomizeObj.cs(156,93): error CS1502: The best overloaded method match for `PhotonNetwork.Instantiate(string, UnityEngine.Vector3, UnityEngine.Quaternion, int)’ has some invalid arguments
Here is the whole script.