Quantcast
Viewing all articles
Browse latest Browse all 56

How to get NetworkViewID and GameObject attached to NetworkViewID

I can't seem to find reliable information about this. I have a Network View component attached to a game object. How can I access this Game Objects NetworkViewID from code? I have tried `gameObject.networkView.viewID` which seems to return a NetworkViewID (**could someone please confirm this is the NetworkViewID?**). I then pass it to a RPC function as such: @RPC function mountCloud(netViewID : NetworkViewID) { /* TRYING TO IMPLEMENT THE FOLLOWING CODE, DONT KNOW HOW TO GET THE GAMEOBJECT FROM THE NETWORKVIEWID PASSED IN mount = true; mountObject = netViewID.gameObject; ////////////////////////////////////////// mountObject.transform.parent = this.transform; mountObject.transform.localPosition = Vector3(0,0,0); mountObject.collider.enabled = false; setWalk(false);*/ if (networkView.isMine) networkView.RPC("mountCloud", RPCMode.OthersBuffered, netViewID); } If this is the correct way to get the NetworkViewID, **how can I get the gameObject from the NetworkViewID**?

Viewing all articles
Browse latest Browse all 56

Trending Articles