- Home /
Photon Pun 2 "using photon.pun" not working.
this might be a really dumb question but this is my first time using Photon Pun 2 and I have this problem, so i have set up my app id and i can't acces the "using Photon.Pun" at the start of the script, I only have "photon.chat" and "photon.realtime". Again this is propably me being new to photon pun 2, but any help would be appreciated.
Were you able to figure this out? I'm having the same problem.
Answer by LtKelleyUSMC · Aug 14, 2021 at 07:15 PM
Thanks KillitsGaming. I had the same problem. I started out building this game using a version of 2019, but I upgraded Unity to the current version of 2020.2.7f1, and ended up seeing a lot of photon errors, but after doing this Regenerate project files, in: Edit->Preferences->External Tools, and clicking on the Regenerate project files button on the right, I got rid of this using Photon.Pun error, amongst the rest of the errors that were present. Thanks for the solution.
To anyone still struggling with this- this answer worked for me! I had to check some of the boxes for which files to regenerate but I just did them all and it worked perfectly. Thanks for the solution!
Answer by GameDevSK · Mar 15, 2021 at 07:12 AM
I think you have downloaded PUN 1 version that's why this error is happening @sampoperala
Answer by GMONKEY99 · Sep 21, 2020 at 10:08 PM
Make Sure u put ur code inside Photon/PhotonUnityNetworking/Code
Hmm, I don't see that folder. The version I'm using has Assets/PhotonUnityNetworking and then Demos, Editor, Plugins, Resources, and UtilityScripts as subfolders. As far as I can tell, Photon.Pun doesn't work in any of them.
Answer by Jonas-Weber · Nov 04, 2020 at 04:10 PM
I fixed that problem on my machine by removing and re-importing PUN. May there were some issues while importing.
I also switch to .NET 4.x bevor reimport. But I don't know if this had any affect to it.
Answer by FoenixPhire · Nov 10, 2020 at 09:03 PM
So I had a very similar issue where most of the scripts could not find other scripts such as "using Photon.Pun". I'm not sure if it is some permissions error but as long as a script was not in the same folder it would not be recognized. I'm not really sure how to fix it but changing the unity version to the latest version worked for me. I had been using version 2019.3.12f1 and once I changed it to 2020.1.4f1 the scripts were able to find other scripts within the assets folder without having to be in the same exact folder. Good luck and I hope that this helped.