void PlayerAttack(GameObject go) { if (go != null && go.tag == "Player") { Damagable health = go.GetComponent <Damagable>(); if (health != null) { health.RunRPCMethod(Damage); hit = true; } if (DestroyOnHit) { Destroy(gameObject); } } }