Syncing help [UdonSharp]

Hi I’m trying to learn Udon and as a demo I’m trying to sync this spinning cube’s speed level across multiple clients. Basically I want any player to be able to click it and make it spin faster for all players.

I have this UdonSharp code so far

public class UdonKyoob : UdonSharpBehaviour {
    [UdonSynced(UdonSyncMode.Linear)]
    float speedSetting = 0;

    public override void Interact() {
        Networking.SetOwner(Networking.LocalPlayer, gameObject);
        speedSetting = (speedSetting + 1) % 5;
    }

    public void Update() {
        float speed = 10 * Mathf.Pow(7, speedSetting);
        transform.Rotate(Vector3.up * Time.deltaTime * speed);
    }
}

As you can see I have the UdonSynced annotation on the speedSetting and I’m using Networking.SetOwner() to set the owner to the player that clicked it, but the speedSetting is not being synced across clients. Each client still has their own independent speed that the cube is spinning at. Does anyone know what I’m doing wrong?

Currently, when you use setOwner, you need to wait a few updates before any synced variables can be changed.

It’s a known issue, and hopefully will be sorted.