Bullet despawn on leaving view

This commit is contained in:
trotFunky 2019-09-19 11:38:00 +02:00
parent 505715a368
commit 5d4c030d9b

View file

@ -46,4 +46,9 @@ public class Bullet : MonoBehaviour
{ {
Destroy(gameObject); Destroy(gameObject);
} }
private void OnBecameInvisible()
{
Destroy(gameObject);
}
} }