Advertisement
jemmm

Bullet

Sep 23rd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement