testing why enemies jittering
This commit is contained in:
parent
7d6eaae833
commit
d6f204806d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user