Instantiating Text to all clients on a scene canvas?

Options
I've tried multiple variations of the usual tricks for getting instantiation to work across multiple clients but for some odd reason no matter what I try when I instantiate a text to a canvas in game nothing I've tried works. My concept is pretty simple, I'm doing a kill feed on the top right and I'm making it so that a players name and a message gets instantiated across all clients except it only ever seems to work for one client despite me doing an RPC call for AllBuffered.

Here's the relevant pseudo code, would appreciate the help, what's weird is gameobjects and so on work fine with this method but the text only instantiates correctly on the local client and not on the other clients connected.
if (health <= 0 && hasLocalDeadPlayerTextInstaniated == false)

            {
                photonView.RPC("RPC_InstantiateDeadPlayerText", RpcTarget.AllBuffered);
                animator.SetTrigger("PlayerSickAnimation");
                hasLocalDeadPlayerTextInstaniated = true;
            }

[PunRPC]
    public void RPC_InstantiateDeadPlayerText()

    {
            GameObject deadPlayerTextEmptyLocal = Instantiate(deadPlayerTextEmpty, deadPlayerPanel.transform.position, Quaternion.identity);
            localDeadPlayerText = deadPlayerTextEmptyLocal.GetComponentInChildren<Text>();
            localDeadPlayerText.text = PhotonNetwork.LocalPlayer.NickName + " has died"; 
            localDeadPlayerText.transform.SetParent(deadPlayerPanel.transform);
    }

Comments

  • Lethn
    Options
    Oh I should add this is both within (photonView.isMine) and (!photonView.isMine) because I was wondering if there was some interference happening due to that.