Hi there,
I’m having issues sending my bool across the network and I’m using the RaiseEvent from photon and I’m not sure I really understand it and that’s why it’s not working.
My scenario is: there are 4 players and once a player hits a button then they ready up and that’s it but I can’t seem to send the ‘playerXactivated’ bool across.
Here is my code, if someone can help me understand that would be great!
#region Testing Variables
byte eventCode = 0;
bool reliable = true;
#endregion
#region Testing Methods
void OnEnable()
{
PhotonNetwork.OnEventCall += this.OnEvent;
}
void OnDisable()
{
PhotonNetwork.OnEventCall -= this.OnEvent;
}
private void OnEvent(byte _eventCode, object content, int senderid)
{
if(_eventCode == 0)
{
PhotonPlayer sender = PhotonPlayer.Find(senderid);
byte[] test = content as byte[];
for (int i = 0; i < test.Length; i++)
{
byte unitId = test*;*
}
}
}
#endregion
#region Public Methods
public void ThiefCollectionButton()
{
PhotonNetwork.RaiseEvent(eventCode, player1Activated = true, reliable, null);
canvasObj.SetActive(false);
}
Thanks again!