BulletBehaviour.cs 264 B

123456789101112
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class BulletBehaviour : MonoBehaviour {
  5. private void OnTriggerEnter(Collider other)
  6. {
  7. print("hit " + other.name + "!");
  8. Destroy(gameObject);
  9. }
  10. }