Is the network view controlled by this object?
function OnNetworkInstantiate (info : NetworkMessageInfo) { var nView = GetComponent.<NetworkView>();
if (nView.isMine) Debug.Log("New object instanted by me"); else Debug.Log("New object instantiated by " + info.sender); }
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void OnNetworkInstantiate(NetworkMessageInfo info) { NetworkView nView = GetComponent<NetworkView>(); if (nView.isMine) Debug.Log("New object instanted by me"); else Debug.Log("New object instantiated by " + info.sender); } }
Did you find this page useful? Please give it a rating: