- Home /
Question by
atrupb · Dec 11, 2020 at 10:59 AM ·
unity 5networkingphoton
need help with syncing ui canvas
[PunRPC]
IEnumerator SabotageCool(int counter)
{
sabotagedRec = true;
while (counter > 0)
{
SABOTAGE.color = new Color(1f, 1f, 1f, 0.4f);
text.text = counter.ToString();
Debug.Log(counter);
yield return new WaitForSeconds(1f);
counter--;
}
if (counter <= 1)
{
SABOTAGE.color = new Color(1f, 1f, 1f, 1f);
sabotagedRec = false;
text.text = " ";
StopCoroutine("SabotageCool");
}
}
i send it to both taggedplayers.
the counter works, but the visual parts like sabotage.color or the text wont sync over. whats the problem?
here is the rpc command:
photonView.RPC("SabotageCool", readyNotReadyScript.TaggedPlayerNum, 10);
photonView.RPC("SabotageCool", readyNotReadyScript.TaggedPlayerNum2, 10);
Comment
Your answer
