Error with Unity 2019.3.12

Options
Hello,

I am developing an online game in Unity and have been following the Photon Pun tutorial provided.
https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial/intro

Initially I was using Unity version 2019.3.0 but I reached the section on Lobby UI and when I tried adding a function to OnValueChange I was not given the dynamic string option.
https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial/lobby-ui

So after some research I found that was a bug in Unity and was fixed in 2019.3.12, so I upgraded to the new version and now my Photon Library must not be working properly since in the code I get an error on the following line:

using Photon.Pun;

I tried re-importing Pun2 and starting a new project, but I still get the error with the newer version of Unity.

Any help would be much appreciated and if I should post some more info please let me know.

Thanks



Comments

  • So the code runs perfectly, but it seems like its just an error in my Visual Studio code. Not sure why this is happening.
  • mikeycrostar
    Options
    Hello,

    I had the same issue sooner,
    its seem due to the Unity Version 2019.3.12 when I downgrade my project to the previous one (2019.3.11) the auto completion and dependancy works fine.

    You may should think about downgraded until they fix the issue, I don't know if it come from Unity or ExitGame.
  • Wow thanks! I spent the whole day trying to resolve this lol
    I guess it's just an error on Photon's side.
  • Sammytron
    Options
    Hi, can someone explain why autocomplete isn't working for me, I can't find an answer online and I downgraded to 2019.3.11 like you said autocomplete works. I am using VS Code and have a lot of extensions and it works for normal commands like Start() and Update() but not on OnJoinRandomFailed(). I have imported Photon.Pun and Photon.Realtime, and everything works it just won't autocomplete
  • Tobias
    Tobias admin
    edited April 2020
    Options
    Those are issues in Unity builds. I don't know the reason but it's not caused by the Photon code (which either compiles or not but autocomplete is provided by Unity / .Net).

    Sorry about the issues.
    Do you run into issues with 2019.3.11? If not: Use it as long as you can. Updating Unity just for the sake of updates could be a waste of time.

    PUN 2 and PUN Classic got updates in the Asset Store, which fix a few issues in our demos. They were using GUI methods that are now removed from 2019.3. Get the newest package to make sure this is not the problem.
  • Sammytron
    Options
    Yes, I have run into the autocomplete issues in 2018.4.15, 2019.3.12, and also 2019.3.11 and I have the most updated photon package
  • ShuntBalushian
    Options
    That's strange Sammytron. When I switched back to 2019.3.11 it resolved my issue.

    On a slightly unrelated note, Photon is based on Unity's network infrastructure which they announced is going to be depreciated. Does this mean anything for us using Photon? Will some of the features be depreciated or will the underlying codebase of Photon be adapted to the new Unity online feature set?

    Thanks again for the responses this was really helpful.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited May 2020
    Options
    Hi @ShuntBalushian,

    Thank you for choosing Photon!
    On a slightly unrelated note, Photon is based on Unity's network infrastructure which they announced is going to be depreciated. Does this mean anything for us using Photon? Will some of the features be depreciated or will the underlying codebase of Photon be adapted to the new Unity online feature set?
    Photon is not based on "Unity's network infrastructure". Photon has its own APIs, SDKs and server/network infrastructure. So Photon is independent from Unity in this and is here to stay.
    In fact, Photon works outside of Unity.
  • wjurica
    wjurica
    edited May 2020
    Options
    I did notice that code files in PhotonRealtime.csproj never has SUPPORTED_UNITY defined here:

    #if UNITY_4_7 || UNITY_5 || UNITY_5_3_OR_NEWER
    #define SUPPORTED_UNITY
    #endif

    ...leading to many compile issues in VS.

    It seems that the UNITY_5_3_OR_NEWER flag is not called in Unity 2019.3.12 with VS2019. My guess is there may be more such issues.
  • ShuntBalushian
    Options
    Nice thanks for all the responses! Ya'll are super helpful