Fix Enemies spawn outside the map

This commit is contained in:
2023-10-23 11:16:27 +02:00
parent 9f01f671dd
commit 9605c09f5d
+5
View File
@@ -25,6 +25,11 @@ public class Ennemy : MonoBehaviour
{
transform.parent = null;
}
if (transform.position.x < -22f || transform.position.y > 15f || transform.position.x > 25f || transform.position.y < -19.5f)
{
Destroy(gameObject);
}
}
private void Start()