Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Bullet : MonoBehaviour
- {
- public float bulletSpeed = 10.0f;
- void Update()
- {
- transform.Translate(Vector3.forward * bulletSpeed * Time.deltaTime);
- Destroy(this.gameObject, 3.0f);
- }
- private void OnTriggerEnter(Collider other)
- {
- if(other.gameObject.tag != "Enemy" && other.gameObject.tag != "PickUp")
- {
- Destroy(this.gameObject);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement