[RESOLVED] PUN Free Import errors and warnings

Options
Hello, today i've tried to use PUN Free (ver: 1.26.1) on my project but when i'm download and import from the unity asset store, photon gives me scripts errors and warnings:

[ERROR] Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(1608,29): error CS1061: Type `EventData' does not contain a definition for `Code' and no extension method `Code' of type `EventData' could be found (are you missing a using directive or an assembly reference?)

[ERROR] Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(1834,31): error CS1502: The best overloaded method match for `ExitGames.Client.Photon.IPhotonPeerListener.OnEvent(ExitGames.Client.Photon.EventData)' has some invalid arguments

[ERROR] Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(1834,31): error CS1503: Argument `#1' cannot convert `EventData' expression to type `ExitGames.Client.Photon.EventData'

[ERROR] Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(20,16): error CS0738: `NetworkingPeer' does not implement interface member `ExitGames.Client.Photon.IPhotonPeerListener.OnEvent(ExitGames.Client.Photon.EventData)' and the best implementing candidate `NetworkingPeer.DebugReturn(ExitGames.Client.Photon.DebugLevel, string)' return type `void' does not match interface member return type `void'

[WARN] Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs(142,19): warning CS0436: The type `ConnectionState' conflicts with the imported type `ConnectionState'. Ignoring the imported type definition

[WARN] Assets/Photon Unity Networking/Demos/DemoWorker/Scripts/Game/Player/ThirdPersonNetwork.cs(6,5): warning CS0436: The type `ThirdPersonCamera' conflicts with the imported type `ThirdPersonCamera'. Ignoring the imported type definition

[WARN] Assets/Photon Unity Networking/Demos/DemoWorker/Scripts/Game/Player/ThirdPersonController.cs(31,12): warning CS0436: The type `CharacterState' conflicts with the imported type `CharacterState'. Ignoring the imported type definition

[WARN] Assets/Photon Unity Networking/Demos/MarcoPolo-Tutorial/Monstergame/Resources/Scripts/myThirdPersonController.cs(2,40): warning CS0436: The type `ThirdPersonController' conflicts with the imported type `ThirdPersonController'. Ignoring the imported type definition

uHb4PGN.png

Because of this errors, i can't setup PUN on my project, please help me :(
In my project i use: Unistorm and Realistic FPS Prefab

(Sorry for my bad english :O)

Comments

  • vadim
    Options
    Hi
    I can only suppose conflict with previous installation.
    Remove \Assets\Photon Unity Networking folder in your project and also other folders in assets which may contain PUN files and import plugin again.
    Backup your project first!

    If this would not help, check if plugin works for you at all by importing it in new empty project.
  • clawd31
    Options
    I works! It was "Atavism Core v3" in the Standard Assets !
    OMG :)
    Thx for your help :)
  • I have been trying to load a empty project in UNITY_2017_2 with Photon free and Photon Chat UI. I cannot seem to get it to compile property. I get to the point the it is looking for PhotonNetwork.SetInterestGroups in the NetworkCullingHandler.cs file . Do I need to download this from somewhere to use the Photon Chat UI? (or will the Chat UI be updated at some point?)
  • Hey @johnrbourne,

    the problem is that you have imported the complete Chat UI Kit and have furthermore overwritten files that are more up to date. To get both packages working with each other, please create a new project and continue with one of the following three steps.

    1) Import the Photon Chat UI Kit. You should be fine with that, even if it is not up to date.
    2) Import the Photon Chat UI Kit first and then the PUN package itself (not tested, but should work, you maybe have to do some adjustments on your own).
    3) Import the PUN package first and then only a part of the Photon Chat UI Kit: you only need the Photon UI Kit folder from this package (this maybe requires some adjustments, too).
  • Hey @Christian_Simon
    Thanks much for the advice. I've been trying the different methods that you outline. In the first method, I am getting errors on loading to a new scene - the hashtable ambiguous error with Unity 2017. (this is discussed here: http://forum.photonengine.com/discussion/9788/pun-error-in-latest-unity-beta-2017-1-0b3-hashtable-ambiguous-reference )
    The author of the above posting finds quite a number of files that cause the problem because UNITY_2017 is not defined in #if statements in several files. I attempted to fix by adding the .....|| UNITY_2017 statement at the end of #if's ; However, I didn't succeed.

    I did try the other two methods, but each caused a set of other problems; I'm wondering if Exit Games has a fix for the Chat UI Kit - it is after all a paid asset (albeit a very inexpensive one.)

    I did get the demo chat in the latest Photon download to work fine - so I'm not out of luck - I can use that. However, I do like what Exit games did with the Chat Kit since I have used it in the past. I wonder if the author of the asset could take a quick look at it and see what the problem is when used with Unity 2017?

    Thanks!!
  • Hi @johnrbourne,

    I'm currently wondering why the third option doesn't work for you. I tested this quickly and got it working without problems in Unity 2017. So have you tried importing the PUN package (latest version, currently 1.86, you don't need to import the demos) into a new project before importing the 'important' part of the Chat UI Kit package? As said you only need the 'Photon Chat UI' folder from that package since all other files are already available when having imported the PUN package itself.

    When you have imported both packages, please open the 'Chat Example' scene, take a look at the scene hierarchy and go to Canvas -> Chat and add an AppId to the attached Chat script. It should work afterwards.