Fix Enemies spawn outside the map
This commit is contained in:
@@ -25,6 +25,11 @@ public class Ennemy : MonoBehaviour
|
|||||||
{
|
{
|
||||||
transform.parent = null;
|
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()
|
private void Start()
|
||||||
|
|||||||
Reference in New Issue
Block a user