Advertisement
CakeMeister

2d shooter bullet phan 7

Jul 31st, 2017
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class bullet : MonoBehaviour {
  6.  
  7.     private void OnTriggerEnter2D(Collider2D col)
  8.     {
  9.         if (col.CompareTag("Player"))
  10.         {
  11.             Debug.Log("Hit");
  12.             Destroy(gameObject);
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement