I was a bit confused at the line:
transform.localScale = new Vector2(Mathf.Sign(myRigidBody.velocity.x), 1f);
I just didn’t quite understand what
transform.localScale
did. It seems like we are changing the entire local matrix/coordinates/prefab to a negative scale factor…and this just seems really crazy to me that you would do that just to flip the player.
Obviously I must be missing something here, I just don’t know what. Any help?
To be a bit clearer: It seems like we are flipping the entire worlds coordinate system to negatively scale just to walk the other way.
What is actually going on? Thanks heaps