Fix Enemies spawn outside the map
This commit is contained in:
1 parent
9f01f671dd
commit
9605c09f5d
1 file changed
+5
@@ -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