Search Unity

Third Party PUN 2 / VS 2019 / Unity 2019.3.12f1

Discussion in 'Multiplayer' started by InitusInteractive, May 1, 2020.

  1. InitusInteractive

    InitusInteractive

    Joined:
    Aug 16, 2018
    Posts:
    128
    Good day, I am seeking some assistance. I don't know what else I can try do solve this issue.

    I am using the latest PUN from the Asset Store
    https://assetstore.unity.com/packages/tools/network/pun-2-free-119922

    I am using Unity 2019.3.12f1
    and Visual Studio 2019

    When I attempt to edit any scripts VS complains that it can't find the Photon namespace. It's driving me nuts, I seem to be wasting too much time with this issue.

    The type or namespace name 'Realtime' does not exist in the namespace 'Photon' (are you missing an assembly reference?) PhotonUnityNetworking.Utilities C:\Repos\SRP_Graphs\Assets\Photon\PhotonUnityNetworking\UtilityScripts\Prototyping\ConnectAndJoinRandom.cs 23


    I tried
    deleting all csproj, sln and .vs files/folders, restarted
    deleting above plus Library folder
    Removing the asset completely and reimporting.

    HOWEVER, Unity itself doesn't complain and it complies correctly.

    If I use Visual Studio Code it seems to not complain but I can't use VSCode due to lack of debugging and various VS2019 tools.

    It seems to be something to do with VS2019? I can only assume but I can't find anyone else with the same issue. It was working just fine the day before, I re-opened it and now I have this issue.

    Also.

    It does see these namespaces, but only these ones.

    using Photon.Pun;
    using Photon.Pun.UtilityScripts;

    Any suggestions would be GREATLY appreciated.
     
  2. InitusInteractive

    InitusInteractive

    Joined:
    Aug 16, 2018
    Posts:
    128
    It seems to be the Unity Version

    I went back to .11f1 and I no longer see the issue. If I use 12f1, the issue returns.
     
  3. nikescar

    nikescar

    Joined:
    Nov 16, 2011
    Posts:
    165
  4. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I'm also having library linking issues with unity 2019.3.12 not related to PUN, but I feel its the same issue.

    It only happens in Visual Studio, unity compiles properly.
     
  5. Nicooo_

    Nicooo_

    Joined:
    Aug 4, 2019
    Posts:
    2
    Maybe Visual Studio did not automaticaly load PUN assemblies in the .sln project.
    Check if PUN assemblies are well displayed in the 'project' window on VS. If not, you can add them by hand.
     
  6. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    Issue was acknowledge then fixed, it reappeared in unity 2019.4.5f1 LTS
     
  7. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Oh, that's new to me. Will add this to the troubleshooting page. Thanks.
     
  8. sudunity12

    sudunity12

    Joined:
    Feb 10, 2018
    Posts:
    14
    It also reappeared in unity 2019.4.11.
    I was using a photon.
    but it not able to access using photon.pun. I was trying for 2 days didn't solve it.
    but today I also try to solve it, in the middle of nowhere it automatically get solved.
    maybe related to assembly file and vs code.
    I don't know how it gets solved but before that, i deleted all library files and .csproj files. then open the script from unity multiplay time.
     
  9. sudunity12

    sudunity12

    Joined:
    Feb 10, 2018
    Posts:
    14
    The best way to avoid this type of error is --Use Visual studio 2019
     
    ken_unity779 likes this.
  10. ken_unity779

    ken_unity779

    Joined:
    Sep 19, 2020
    Posts:
    2
    Me too. Switched to Visual Studio 2019 and it all works great. Autocomplete sees all the Photon namespaces. I didn't even need to bother with a project; just opened the folder. I haven't tried debugging with it yet though.

    IMO can't blame either Unity or Photon, even though different versions work (i.e. distinction between a flaw and a trigger). If it compiles then the IDE should work, else the IDE is broken.

    However, it would be helpful to figure out what triggered vscode to fail.