Unity2D Sprite flipping not syncing

So, my player movement in my 2d game is based off of flipping the sprite left when its going left, and flipping it right when going right(using transform.localScale). now, for some reason, this flipping is not syncing over to other clients. any fixes?
code:
void Update()
{
        movement.x = Input.GetAxisRaw("Horizontal");
        if (movement.x < 0)
        {
            transform.localScale = new Vector3(-5, 5, 5);
        }
        else if (movement.x > 0)
        {
            transform.localScale = new Vector3(5, 5, 5);
        }       
}

Comments

  • have you solved this problem? I have the same. I tried to flip the sprite using the next code, but the sprite only advance in the direction it is facing (changes its world coordinates too)

    if (velocity.x < 0 && !fliped )
    {
    transform.Rotate(0,-180,0);
    fliped = true;
    }

    if (velocity.x > 0 && fliped )
    {

    transform.Rotate(0,180,0);
    fliped = false;

    }
  • Hi,
    Are you using the transform view component and using it at "onreliablechange"?