Networking Canvas

I have at the moment a FPS game on networking,

Functionally each player moves and syncs fine, they can change weapons, fire bullets, bullets collide with anything not myPlayer or bullet, deal damage if the collider obj has playerHealth component.
Players can die and respawn.

It all went well, teaching myself network.

But now I’m stuck, I have a canvas holding a Text, in health script, it updates the health value on canvas. It only ever shows me the health of the target i have last hit, not my health.

I’m new to networking so i just cycled through everything I could think of, like an isLocalPlayer check, sending it through [command] then back as Rpc, then just on [client], always only 2 possible results; see targets health on my canvas OR no change to health on canvas.

I’m out of ideas, can someone help point me in the right direction here?

method TakeDamage is trigger via the bullets that where networkserver.spawn in.
the codes currently very butchered, I’ve rewritten sections over and over and now my brain is mush.

public const int maxHealth = 100;
	[SyncVar] public int currentHealth = maxHealth;

	public Text healthUI;

	void OnEnable () {
		healthUI = GameObject.Find ("healthHUD").GetComponent<Text> ();
	}

	public void TakeDamage (int amount) 
	{
		if (!isLocalPlayer) 
		{
			currentHealth -= amount;
			if (currentHealth <= 0) 
			{
				currentHealth = 0;
				DeathDisable ();
			}

			UpdateHealth ();
		}
	}

	void DeathDisable () 
	{
		GetComponent<CharacterController> ().enabled = false;
		GetComponent<multiplayer_WeaponsSelection> ().enabled = false;
		GetComponent<multiplayer_SpawnBullets> ().enabled = false;
		GetComponent<UnityStandardAssets.Characters.FirstPerson.FirstPersonController> ().enabled = false;
		Invoke ("Respawn", 5f);
	}

	void Respawn () 
	{
		GetComponent<CharacterController> ().enabled = true;
		GetComponent<multiplayer_WeaponsSelection> ().enabled = true;
		GetComponent<multiplayer_SpawnBullets> ().enabled = true;
		GetComponent<UnityStandardAssets.Characters.FirstPerson.FirstPersonController> ().enabled = true;
		transform.position = new Vector3 (0, 1, 0);
		currentHealth = maxHealth;
		UpdateHealth ();
	}

	void UpdateHealth () {
		healthUI.GetComponent<multiplayer_HealthUI> ().UpdateHealth (currentHealth);
	}

I have a bit of experience with personal UI texts for players using the Photon Unity Networking package. If you are using it: create a GUI.Label from a script. For a crosshairs, make a Canvas on the scene and Image and put the crosshair in that.

@Addyarb
I use Photon Unity Networking. It requires an account but it’s free :3
It’s supposedly better than the default Unity Networking.

using UnityEngine;
using System.Collections;

public class NetworkManager : MonoBehaviour
{
    private CursorLockMode cursor;

    void Start()
    {
        Connect();
        Cursor.lockState = cursor;
    }

    void Connect()
    {
        PhotonNetwork.ConnectUsingSettings("v1");
        Debug.Log("Joined with version 1");
    }

    void OnConnectedToMaster()
    {
        Debug.Log("Joined Master Lobby");
        PhotonNetwork.JoinRandomRoom();
    }

    void OnPhotonRandomJoinFailed()
    {
        Debug.Log("Failed to Join a Random Room");
        PhotonNetwork.CreateRoom (null);
        Debug.Log ( "Created a Room With No Name");
    }

    void OnJoinedRoom()
    {
        Debug.Log("Successfuly Joined a Room");
        SpawnPlayer();
    }

    void SpawnPlayer()
    {
        GameObject MyPlayer = PhotonNetwork.Instantiate("Player", new Vector3(0, 1, 0), Quaternion.identity, 0);
        MyPlayer.transform.FindChild("Camera").gameObject.SetActive(true);
        ((MonoBehaviour)MyPlayer.GetComponent("FirstPersonController")).enabled = true;
    }
}