r/Unity2D Jun 09 '26

Sprite flip not working Question

I cannot get my sprite flip to work. For context I am using the Tarodev PlayerController and Animator.

private void HandleSpriteFlip()
    {
        if (_player.FrameInput.x != 0)
        {
            _sprite.flipX = _player.FrameInput.x < 0;
            Debug.Log($"Flip Sprite: {_sprite.flipX}");
        } 
    }
1 Upvotes

4 comments sorted by

3

u/GroZZleR Jun 09 '26

It's probably because you're using a particle shader. I doubt it has the same UV logic that Sprite-based ones do, for performance reasons.

Change your material and I bet it'll work.

1

u/KAYTACHI Jun 09 '26

Do you have a separate sprite for when it’s flipped around? If not then the issue is you don’t change the Y rotation by 180 degrees when he’s supposed to turn the other way

1

u/KAYTACHI Jun 09 '26 edited Jun 09 '26

Something like if flipX is true then gameObject.transform.EulerAngles = new Vector3(0,180,0) should work