Unity 5.1 - 2D Networking

I’m trying to create a 2D multiplayer game with new networking system. I attached Network Transform to player prefab and it detected rigidbody2d and top down Y rotation to sync. Rigidbody syncing but rotation is not sync. What should I do to sync rotation?

void FixedUpdate () {
        if (!isLocalPlayer)
            return;
            grounded = Physics2D.OverlapCircle (groundCheck.position, groundRadius, whatIsGround);
            float move = Input.GetAxis ("Horizontal");
            GetComponent<Rigidbody2D>().velocity = new Vector2 (move * maxSpeed, GetComponent<Rigidbody2D>().velocity.y);
            if (!facingRight) {
                Flip ();
            } else if (facingRight) {
                Flip ();
            }
    }

void Flip()
    {
        facingRight = !facingRight;
        transform.Rotate(Vector2.up * 180);
    }

Anyone help?

Just to see what happens, in case your coordinates are set up differently, did you try syncing just the Z rotation instead?

Yes I tried all rotations but not syncing. If you know how to sync scale, it would help too.

I’m currently working on it too, but it would be nice, if unity make update for network transform component, to make it sync scale.

Rotations dont seem to sync with NetworkTransform, so instead make your facingRight a syncvar, then as the local client, send the Command to server to change the syncvar. And let all clients calculate the rotation.

Can you show a piece of this code?

havent tested this but it should work. So if your move is greater than 0 then youre facing right, or else facing left. And so this value is sent to server so it could be changed on all clients, however it wont change for client who sent the value. Also the part where the transform is flipped is ran on all clients.

[SyncVar(hook="OnFacingRight")]
public bool facingRight; //this bool will sync on all clients

//this function will execute because of the syncvar hook
void OnFacingRight(bool newValue)
{
   //the new value is to all clients except the local client
   if(!isLocalPlayer)
   {
     facingRight = newValue;
   }
}
[Command]
void CmdFlipTo(bool isRight)
{
   facingRight = isRight;
}
bool lastFacingRight;
void Update()
{
   if(isLocalPlayer)
   {
     //facing right equals to true if moving right, or else its moving left
     facingRight = move > 0;

     //used to save bandwidth, so it sends only when its changed
     if(lastFacingRight != facingRight)
     {
       lastFacingRight = facingRight;
       CmdFlipTo(facingRight); //value set to all clients
     }
   }
   //this will run for all clients
   if(facingRight)
   {
     transform.localEulerAngles = Vector3.zero;
   }
   else
   {
     transform.localEulerAngles = new Vector3(0,180,0);
   }
}