Files
berry-dash-with-guns-custom/Assets/Scripts/BulletCleanup.cs
T
2025-10-04 11:20:33 -07:00

11 lines
290 B
C#

using UnityEngine;
public class BulletCleanup : MonoBehaviour
{
void Update()
{
Vector3 screenPos = Camera.main.WorldToViewportPoint(transform.position);
if (screenPos.x < 0f || screenPos.x > 1f || screenPos.y < 0f || screenPos.y > 1f) Destroy(gameObject);
}
}