How to change the direction of a character?

Hello,
I have faced a problem that I dun know how to rotate the character to the right after I pull the joystick to the right
I have tried to rotate the character using transform but the character is disapper (or transparent) after I rotated the character 180 degree. Is there any way to deal the above problems at the same time?
Thank You


It sounds to me like you want to flip the character, not rotate it. You can do that by simply assigning to spriteRenderer.flipX. Or, if you want the colliders and child objects to flip too, then update transform.localScale (setting .x to -1 to flip, or 1 to unflip).

Also, when you want to post code, please don’t post a screen shot of it. Paste the code into code tags.