Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Third Party [Photon Networking] Can't trigger OnEvent()

Discussion in 'Multiplayer' started by nensl, Sep 27, 2017.

  1. nensl

    nensl

    Joined:
    May 30, 2016
    Posts:
    6
    Hi guys,
    First time working with PUN.

    Soo, I'm stuck on an event call.
    I really don't know why and I'm using most of the code from this tutorial on the Photon Site:
    https://doc.photonengine.com/en-us/pun/current/tutorials/oculusavatarsdk


    public void OnJoinedRoom()
    {
    Debug.Log("OnJoinedRoom succesful");
    int viewId = PhotonNetwork.AllocateViewID();

    PhotonNetwork.RaiseEvent(InstantiateVrAvatarEventCode, viewId, true, new RaiseEventOptions() { CachingOption = EventCaching.AddToRoomCache, Receivers = ReceiverGroup.All });
    }

    private void OnEvent(byte eventcode, object content, int senderid)
    {
    Debug.Log ("Eureka..");
    if (eventcode == InstantiateVrAvatarEventCode)
    {
    [...]



    I'm getting the first Log but It never outputs the second one.

    I hope you can help me and feel free to ask if something's unclear :)

    Cheers,
    Jawah
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,086
    So the "OnJoinedRoom succesful" message is there? Is anything else in the logs that might be useful?