Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

Raise event - event not firing

$
0
0
Hi,

I am probably missing something simple - My understanding with Raise Event is that the object raising the event and the one receiving it do not need to have a PhotonView component?

I am not 100% that this is correct... Here is how I am trying to set this up. Any help is appreciated.


This is the code I have on my receiving object:

void OnEnable()
{
PhotonNetwork.OnEventCall += this.OnEvent;

}
void OnDisable()
{
PhotonNetwork.OnEventCall -= this.OnEvent;
}
// handle custom events:
void OnEvent(byte eventcode, object content, int senderid)
{
Debug.Log("event"); // never fires
}



And the sending object:

// raise event
byte evCode = 0;
float tempVar = 1.0f;

float[] content = new float[] { tempVar };

bool reliable = true;
PhotonNetwork.RaiseEvent(evCode, content, reliable, null);

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>