There’s a typo in the code in one of the tutorials I’m following. I couldn’t find anywhere obvious to report it.
https://unity3d.com/learn/tutorials/topics/multiplayer-networking/networking-player-health
This is the code in the text description which won’t work (wrong variable names)
void OnChangeHealth (int currentHealth)
{
healthBar.sizeDelta = new Vector2(health, currentHealth.sizeDelta.y);
}
The “The final script should look like this:” section has the proper working code.