Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Bullet : MonoBehaviour
  6. {
  7. public int damage;
  8. public float speed;
  9.  
  10. private Rigidbody rb;
  11.  
  12. private void Start()
  13. {
  14. rb = GetComponent<Rigidbody>();
  15. rb.velocity = transform.up * speed;
  16. }
  17.  
  18. private void OnCollisionEnter(Collision other)
  19. {
  20. Destroy(gameObject);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement