Why can't I access a Unity UI Button from RPC Call?
Options
Hi all,
I'm trying to access a button in a remote players Canvas.
Example:
However, that RPC seems to properly work on everything except for my button, in this code here:
I'm able to see the correct channelName passed and the print statement, but no changes on either client specifically regarding the button.
The button is a child of Canvas, which is a child of Charprefab, where the script/PhotonView is located.
I'm new to Unity Photon/Networking, any help is appreciated, thanks!
I'm trying to access a button in a remote players Canvas.
Example:
I'm able to successfully call the RPC on the specific player I'm inviting here:I walk close enough to player.
I click "Invite".
On their screen they see a "Join" button pop up.
They press "Join".
Something happens etc...
public void OnInviteButtonPress() { if(remotePlayerID != -1) { photonView.RPC("InvitePlayerToPartyChannel", PhotonPlayer.Find(remotePlayerID), GetComponent<AgoraVideoChat>().GetRemoteChannel()); } }
However, that RPC seems to properly work on everything except for my button, in this code here:
[PunRPC] public void InvitePlayerToPartyChannel(string channelName) { remoteInviteChannelName = channelName; joinButton.SetActive(true); print("I've been invited to join channel: " + remoteInviteChannelName); }
I'm able to see the correct channelName passed and the print statement, but no changes on either client specifically regarding the button.
The button is a child of Canvas, which is a child of Charprefab, where the script/PhotonView is located.
I'm new to Unity Photon/Networking, any help is appreciated, thanks!
0