Hello Unityrs,
I have this very simple questions to pose: the function wwwLoadObjects is an RPC called by any client in my networked 3D environment. It loads an .OBJ file. Now, this works perfectly whether I call Network.Instantiate or not.
So, my question is why? Does it matter the Network.Instantiate?
Many Thanks.
GC.
@RPC
function wwwLoadObjects(sender: String, addrs: String) {
obj = new OBJ();
filename = addrs;
StartCoroutine(obj.Load(addrs));
//Debug.Log( "OBJ: " + obj);
Debug.Log(“wwwLoadObjects”);
obj.transform.position = Vector3(0,5,0); //Positioning the object in (0,0,0);
// obj.AddComponent(networkView); //Enalbles the new object to be linked
//obj.GetComponent(NetworkView).n = NetworkStateSynchronization.ReliableDeltaCompressed;
obj.AddComponent(BoxCollider);
obj.AddComponent(Rigidbody);
TObj = obj.transform;
Network.Instantiate(TObj, obj.transform.position, obj.transform.rotation,3);
Debug.Log(“---- NETWORK ID:”);
Debug.Log(“----” + obj.GetComponent(NetworkView).viewID);
Debug.Log(“------ AFTER NETWORK INSTANTIATE”);
Debug.Log(“wwwLOADEDOBJECT”);
}