UNET syncvar hook not being called

Hello.
I am having a go at making a multiplayer game and am having troubles with one of my syncvars.

I have these two scripts:

A Health class:

public class Health : NetworkBehaviour {
    [SerializeField]
    protected float maxHealth = 100;

    [SyncVar(hook = "OnCurrentHealthChanged")]
    protected float currentHealth;

    public void ResetHealth()
    {
        
        Debug.Log("RESETTING HEALTH: " + maxHealth);
        currentHealth = maxHealth;
        Debug.Log("HEALTH RESET: " + currentHealth);
        
    }

    public void TakeDamage(float damageAmount)
    {
        currentHealth -= damageAmount;
    }

    private void OnCurrentHealthChanged(float newHealth)
    {
        currentHealth = newHealth;
        Debug.Log("ONCURRENTHEALTHCHANGED: " + newHealth);
        HealthChanged(newHealth);
        if(newHealth <= 0)
        {
            OnDeath();
        }
    }

    protected virtual void HealthChanged(float newHealth)
    {
        Debug.Log("HEALTHCHANGED: " + newHealth);

    }

    protected virtual void OnDeath()
    {
        Debug.Log("DEAD");
    }
}

and a PlayerHealth class which extends the base Health class:

public class PlayerHealth : Health {

    [SerializeField]
    private Text HealthText;
    [SerializeField]
    private Text CoopHealthText;

    public void SetHealthText(string text)
    {
        HealthText.text = text;
    }
    public void SetCoopHealthText(string text)
    {
        CoopHealthText.text = text;
    }
    [Command]
    public void CmdResetHealth()
    {
        Debug.Log("CMDRESET");
        ResetHealth();
    }
    protected override void HealthChanged(float newHealth)
    {
        base.HealthChanged(newHealth);
        if (isLocalPlayer)
        {
            SetHealthText(newHealth.ToString());
        }else
        {
            SetCoopHealthText(newHealth.ToString());
        }
    }

    protected override void OnDeath()
    {
        if (isLocalPlayer)
        {
            CmdResetHealth();
            GetComponent<PlayerMovement>().Respawn();
        }
        
    }
}

When a player takes damage, the currentHealth is synced fine across the networks and both client and server gets the updated health. When the clients health gets below 0, it successfully respawns and its health resets to the maxHealth.

The issue however is when the server’s health reaches below 0. It successfully respawns but its currentHealth is not being set to the maxHealth. Using various debug messages I have concluded that this is because the OnCurrentHealthChanged() hook is not being called.

The function ResetHealth() is being called however, and since that function modifies currentHealth, shouldn’t the hook be called?

Also, it’s working fine when the client’s die, just not when the server does, which is what’s really confusing me.

Thank you for reading. I hope someone knows what the issue is.

Return to unity’s Networking TUT