i want to disable your own body for your own camera. and still let other people (with the same player prefab) see my player’s body.
i found NetworkView.isMine but it doesnt work.
how can i do this?
using UnityEngine;
using UnityEngine.Networking;
public class PlayerSettup : NetworkBehaviour {
public GameObject bodyPart;
public GameObject bodyPart1;
void Start () {
if (NetworkView.)
{
bodyPart.SetActive(true);
bodyPart1.SetActive(true);
}
else
{
bodyPart.SetActive(false);
bodyPart1.SetActive(false);
}
}
}
It involved setting up a NetworkIdentity in the tutorial earlier, and you then had access to a nice, simple bool: isLocalPlayer.
Does that help?
I assume the latter part of your code is correct, so…
using UnityEngine;
using UnityEngine.Networking;
public class PlayerSettup : NetworkBehaviour {
public GameObject bodyPart;
public GameObject bodyPart1;
void Start () {
if (isLocalPlayer)
{
bodyPart.SetActive(true);
bodyPart1.SetActive(true);
}
else
{
bodyPart.SetActive(false);
bodyPart1.SetActive(false);
}
}
}