SHARE
TWEET

Bullet

jemmm Sep 23rd, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class BulletController : MonoBehaviour
  6. {
  7.     // Start is called before the first frame update
  8.     void Start()
  9.     {
  10.        
  11.     }
  12.  
  13.     // Update is called once per frame
  14.     void Update()
  15.     {
  16.        
  17.     }
  18.     private void OnCollisionEnter(Collision collision)
  19.     {
  20.         if (collision.gameObject.tag == "Enemy")
  21.         {
  22.             Destroy(collision.gameObject);
  23.         }
  24.         Destroy(gameObject);
  25.     }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top