how to show different text on both clients using text Mesh pro ?
I want to show win / lose message on both players respectively , Only issue is it only shows you lost on both sides , Here is my code please see it
[PunRPC]
public void RPC_giveDamage(int damage)
{
if (CurrentHealth <= 0)
{
if (pv.name.ToString().Contains("MalePlayer2") && pv.GetComponent<PlayerHealth>()?.CurrentHealth == 0)
{
winlose.setResult("You lost"); // Here show this message to lost player only
}
if (pv.name.ToString().Contains("FemalePlayer2") && pv.GetComponent<PlayerHealth>()?.CurrentHealth == 0)
{
winlose.setResult("You lost");
}
}
CurrentHealth -= damage;
if (pv.name.ToString().Contains("MalePlayer2"))
winlose.setHealth_1(CurrentHealth.ToString());
if (pv.name.ToString().Contains("FemalePlayer2"))
winlose.setHealth_2(CurrentHealth.ToString());
}
winlose is a gameobject having Text_pro reference