Legacy Documentation: Version 5.6 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

NetworkView.owner

Switch to Manual
public NetworkPlayer owner;

Description

The NetworkPlayer who owns this network view.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnNetworkInstantiate(NetworkMessageInfo info) { NetworkView nView = GetComponent<NetworkView>(); if (!nView.isMine) Debug.Log("New object instantiated by " + nView.owner); } }