Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1.  
  2. private void Flip()
  3. {
  4. // Switch the way the player is labelled as facing.
  5. m_FacingRight = !m_FacingRight;
  6.  
  7. // Multiply the player's x local scale by -1.
  8. Vector3 theScale = transform.localScale;
  9. theScale.x *= -1;
  10. transform.localScale = theScale;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement