title: Unity 2D sprite doesn't flip
body: <p>I'm doing a platformer game with Unity 2D and I wanted to flip the character sprite left when the player move him left, but for some reasons it doesn't work. I tried to make this one script:</p>
  
  <pre><code>transform.rotation = new Vector3(0f, 180f, 0f);
  </code></pre>
  
  <p>but it didn't work. So then I wrote this:</p>
  
  <pre><code>transform.localScale = new Vector3(-0.35f, 0.35f, 1f); //the player's scale x and y are 0.35 by default
  </code></pre>
  
  <p>but it didn't work too. Then I found this error message in the console: <strong>NullReferenceException: Object reference not set to an instance of an object
  UnityEditor.Graphs.Edge.WakeUp () (at C:/buildslave/unity/build/Editor/Graphs/UnityEditor.Graphs/Edge.cs:114)</strong>.</p>
  
  <p>What should I do? I'm doing this game for a game jam so I need to resolve this problem quickly. Thank you.</p>
  
  <p><strong>EDIT</strong>: I noticed that I can flip the sprite in the editor, but that I can't do that using scripts.</p>