Help! Detect changes on X values.

Hello guys! I’m facing a problem, i don’t figure out how to detect changes in X value. I need to do this because i want to use SpriteRenderer.FlipX. I created an enemy that catches the player, and depending on the direction is facing i want it flipped.

You need to do something like:

transform.eulerAngles = new Vector3(0, 0, 0); // Normal

transform.eulerAngles = new Vector3(0, 180, 0); // Flipped

That will flip your character

Olá, boa tarde!

Você pode acessar a propriedade “Flip X” do SpriteRenderer e realizar a troca.