My arrow is instantiated on a different script and has this scripts on it but when the arrow is going to get destroyed it gives
Ev Destroy Failed. Could not find PhotonView with instantiationId 2002. Sent by actorNr: 2
error. I don’t know what to do please help.
using UnityEngine;
using System.Collections;
public class Arrow : MonoBehaviour {
[PunRPC]
void OnCollisionEnter(Collision col){
if (col.gameObject.tag == "Player") {
col.gameObject.GetComponent<Health> ().Die ();
Debug.Log ("CleaningClutter");
if (GetComponent<PhotonView> ().instantiationId == 0) {
Destroy (gameObject);
} else {
if (GetComponent<PhotonView> ().isMine == true) {
PhotonNetwork.Destroy (gameObject);
}
}
}
Debug.Log ("CleaningClutter");
if (GetComponent<PhotonView> ().instantiationId == 0) {
Destroy (gameObject);
} else {
if (GetComponent<PhotonView> ().isMine == true) {
PhotonNetwork.Destroy (gameObject);
}
}
Debug.Log ("CleaningClutter");
}
}
code