using UnityEngine;
public class Bullet : MonoBehaviour { public float lifetime = 2f;
void Start()
{
Destroy(gameObject, lifetime);
}
void OnCollisionEnter(Collision collision)
{
// Add logic here for what happens when the bullet hits an object.
Destroy(gameObject);
}
}