instead of local scale flip, using transform rotate HELP

This is the function i use for my character to turn in my project but instead of flipping the local scale can someone show me transform.rotate script for walking in a 2d game?

I really need rotate more than local scale for all the children attached to the player.

void Flip()
{
facingRight = !facingRight;
Vector3 theFlip = new Vector3 (transform.eulerAngles.x, transform.eulerAngles.y + 180, transform.eulerAngles.z);

transform.eulerAngles = theFlip;
}

Untested, but I think this will do what you are after. In theory this should rotate the entire object around the y axis.

1 Like

Indeed it should work. I tried this about an hour ago and once i tested and tested and still failed i just took a break

I did end up fixing the problem just now, i worked around the character and got my children functions to work with the characters flip but man sometimes Unity’s commands (especially with 2d) make it more complicated than it has to be.