From f5a92706dcccb2a901c3b1ab92db8cacbf73df18 Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 3 Nov 2018 21:17:22 +0000 Subject: [PATCH] Update Flip Logic Update to Flip logic from Brackeys "2D Shooting in Unity (Tutorial)" - https://youtu.be/wkKsl1Mfp5M @2:47 Simply rotate the player. --- CharacterController2D.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CharacterController2D.cs b/CharacterController2D.cs index 925bfe0..f25b8de 100644 --- a/CharacterController2D.cs +++ b/CharacterController2D.cs @@ -138,9 +138,6 @@ private void Flip() // Switch the way the player is labelled as facing. m_FacingRight = !m_FacingRight; - // Multiply the player's x local scale by -1. - Vector3 theScale = transform.localScale; - theScale.x *= -1; - transform.localScale = theScale; + transform.Rotate(0f, 180f, 0f); } }