testing why enemies jittering

This commit is contained in:
Sam 2023-05-06 21:00:15 -07:00
parent 7d6eaae833
commit d6f204806d

View File

@ -47,7 +47,13 @@ public class EnemyPatrol : MonoBehaviour {
void Update() {
if (!pinned) {
if (isHorizontal) {
if (transform.position.x > xRight || transform.position.x < xLeft) {
if (transform.position.x >= xRight || transform.position.x <= xLeft) {
if (transform.position.x >= xRight) {
print(this.gameObject.name + "hit right limit");
}
if (transform.position.x <= xLeft) {
print(this.gameObject.name + "hit right limit");
}
movementVectorHorizontal = -movementVectorHorizontal;
GetComponent<SpriteRenderer>().flipX = !GetComponent<SpriteRenderer>().flipX;
}