Skip to content

Instantly share code, notes, and snippets.

@qqpann
Created June 17, 2021 14:24
Show Gist options
  • Save qqpann/2090673a5c4b39cd6c9e01ffcf589ebe to your computer and use it in GitHub Desktop.
Save qqpann/2090673a5c4b39cd6c9e01ffcf589ebe to your computer and use it in GitHub Desktop.
It's better to use transform than flipX for later convenience.
if (move.x > 0.01f)
//spriteRenderer.flipX = false;
transform.localScale = new Vector2(1, 1);
else if (move.x < -0.01f)
//spriteRenderer.flipX = true;
transform.localScale = new Vector2(-1, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment