Пример #1
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.transform.tag == "impassible surroundings")
     {
         Destroy(gameObject);
     }
     else if (collision.transform.tag == "Player_with_ak")
     {
         Debug.Log("hit player");
         playerMove player = collision.transform.GetComponent <playerMove>();
         player.takeDamage(20f);
         Destroy(gameObject);
     }
 }