Displaying Damage Text/Text Mesh to all clients

Hiya,

So I’m trying to display damage text using a text mesh above players that get damaged over the network, however I can only get it to display to the player that has been damaged.

Right now I have a HealthDamageScript attached to the player prefab that looks like this:

...

public class HealthDamageScript : NetworkBehaviour {

	...

	public Transform damageTextPrefab;

	...


	public void TakeDamage(int damage)
	{
		if (!isServer)
		{
			return;
		}

		...

		RpcDamageText(damage);

		...
	}

	...

	[ClientRpc]
	void RpcDamageText(int damage)
	{
		if (isLocalPlayer)
		{
			Vector3 pos = transform.position;
			pos.y += gameObject.transform.localScale.y;
			GameObject text = Instantiate(damageTextPrefab, pos, Quaternion.identity).gameObject;

			text.GetComponent<TextMesh>().text = "-" + damage;
		}
	}

}

How would I get the RPC to be sent to all clients rather than only the player that has been damaged?

It is being sent to all clients, you are just filtering it with the line
if (isLocalPlayer)
If you remove that IF statement then all copies of the damaged player (both the one local and all the remote copies) will see the damage above their heads