Question by
WillTes · May 27 at 09:19 AM ·
multiplayer-networking
Photon "Failed to 'network-remove' GameObject
using UnityEngine; using System; using System.Collections; using UnityEngine.SceneManagement; using System.Collections.Generic; using Photon.Realtime; using Photon.Pun;
public class Player1 : MonoBehaviour {
public int maxHealth = 100;
public int currentHealth = 100;
PhotonView myPhotonView;
public HealthBar healthBar;
public GameObject Controller;
void Start()
{
healthBar.SetMaxHealth(maxHealth);
}
public void TakeDamage(int damage)
{
if (!myPhotonView.IsMine)
{
currentHealth -= damage;
Debug.Log(currentHealth);
if (currentHealth <= 0)
{
Kill();
}
}
}
public void Kill()
{
if (!myPhotonView.IsMine)
{
PhotonNetwork.Destroy(gameObject);
}
}
void OnCollisionEnter(Collision collision)
{
myPhotonView = GetComponent<PhotonView>();
if (!myPhotonView.IsMine)
{
{
if (collision.gameObject.tag == "Bullet")
{
Destroy(collision.gameObject);
TakeDamage(20);
Debug.Log("Collision Detected");
}
if (collision.gameObject.tag == "Bullet2")
{
Destroy(collision.gameObject);
TakeDamage(40);
Debug.Log("Collision Detected");
}
if (collision.gameObject.tag == "Bullet3")
{
Destroy(collision.gameObject);
TakeDamage(50);
Debug.Log("Collision Detected");
}
if (collision.gameObject.tag == "Bullet4")
{
Destroy(collision.gameObject);
TakeDamage(100);
Debug.Log("Collision Detected");
}
}
}
}
}
Comment
Whenever I try to remove a player that has died I get this error.
Failed to 'network-remove' GameObject. Client is neither owner nor masterClient taking over for owner who left: View (0)2001 on Player(Clone)
Please help thank you :)
Your answer

Follow this Question
Related Questions
How to Share UI across multiple client 1 Answer
How do I implement a message based network system UNITY 5? 0 Answers
Photon RPC Only Working Halfway 1 Answer
Unity3D with Netty or SCS 0 Answers
Networking - Function runs on server but not on client? 2 Answers