2024-11-12 17:24:59 +01:00

14 lines
255 B
C#

using UnityEngine;
public class DestroyByPosition : MonoBehaviour
{
public float destroyPositionY = -10;
void Update()
{
if(transform.position.y < destroyPositionY)
{
Destroy(this.gameObject);
}
}
}