using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class BulletHitted : MonoBehaviour { public AudioClip HitSound; private AudioSource audioSource; int Lives=3; // Use this for initialization void Start () { audioSource = GetComponent(); } // Update is called once per frame void Update () { } void OnTriggerEnter(Collider other) { if (other.tag == "enemy") { audioSource.PlayOneShot(HitSound); other.gameObject.transform.position = new Vector3(0, 5.0f, -1); //Destroy(this.gameObject); } } }