So in my game my character has a self-destruct feature. With this code:
if(networkView.isMine){
if(Input.GetKeyDown (KeyCode.Mouse0)){
GameObject instantiatedProjectile = (GameObject)Network.Instantiate(sefDestruct, transform.position, transform.rotation,0);
instantiatedProjectile.GetComponent<Detonator>().Explode();
Network.Destroy(this.gameObject);
}
}
my character doesn’t dissapear on fire. But if I comment out the two lines spawning the explosion then he does.
//GameObject instantiatedProjectile = (GameObject)Network.Instantiate(sefDestruct, transform.position, transform.rotation,0);
//instantiatedProjectile.GetComponent<Detonator>().Explode();
What gives?
Are there any errors printed out? Sometimes when Unity runs into errors, some undesirable things can happen to the things near the error.
– stevethorne