From 7e6486775fa461a4d3fdbb744de1490c4f510c01 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 2 Jan 2023 14:17:39 +0100 Subject: [PATCH] Do not turn player graphics if the x axis did not change --- assets/Scripts/Game/Unit/Player/Player.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/Scripts/Game/Unit/Player/Player.ts b/assets/Scripts/Game/Unit/Player/Player.ts index c177ae2..4e7f1ef 100644 --- a/assets/Scripts/Game/Unit/Player/Player.ts +++ b/assets/Scripts/Game/Unit/Player/Player.ts @@ -91,9 +91,9 @@ export class Player extends Component { this.animation.play("Move"); } - if (movement.x <= 0) { + if (movement.x < 0) { this.playerGraphics.setScale(new Vec3(1, 1, 1)); - } else { + } else if (0 < movement.x) { this.playerGraphics.setScale(new Vec3(-1, 1, 1)); } } else {