The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

[Solved] Photon PUN broken in build, works in editor

2016-05-11 00:55:00

Greetings. We ran into a strange issue today while making builds and it has us stumped. We pushed out 2 builds today on our game, the first build works perfect and is live. However, I realized I forgot to enable something for one of the character classes so I had to make one tiny change and then rebuild. Upon this rebuild, and every build after, Online mode fails. We have a Single Player mode that uses Offline mode, and Multiplayer mode. When running in the editor, multiplayer works fine and loads up the room list, create a room, etc. However, after building, when trying to enter multiplayer mode it somehow thinks the game is in offline mode, and goes into single player mode (no server list). Earlier today, when online mode was working in the first build we made live, we went back and forth between single and multiplayer mode. Not sure if there is some kind of bug there.

We even reverted our project via our REPO to the previous day, which has a working build that is live on Steam....and still we can no longer make builds that have a working online mode. :/ When running the build with Development Build mode on, since everything works correctly, there are no error messages. ::open_mouth: Something seems to be breaking it in builds, but not if Development mode is enabled. So far we tried setting the project to 64bit and back to 32, multiple project and PC restarts, resetting our internet and router and just double checking everything. When it comes down to it however, looking at our changes in the repo, there just wasn't anything worked on that was Photon related this morning - yet somehow, between making the 2 builds, something broke Photon in our project. Since it works fine in the editor, there are no errors there as well. This is a critical issue for us right now, we have a live game on Steam and cannot make updates since Photon fails on the build now for some reason.


2016-05-11 01:03:52

I would like to add that upon further testing, many things that use some sort of Photon code in Offline mode, that works in previous builds and also in the editor, breaks in the current build as well.

2016-05-11 13:22:53

Just copied the Photon DLL from the Steam directory of the working copy and pasted it into the most recent build where PHOTON is broken, but that doesn't seem to fix it either. I have also tried to switch regions from US to EU and back to US, and this did not fix it either.

2016-05-11 15:17:20

Does your REPO include the project settings folder? Can you do a strict reset to the revision from yesterday that worked? In SVN there is a way to delete unversioned files, etc.

Did you update PUN? Or Unity?
The offline mode is handled in the code that's in this folder:
Assets\Photon Unity Networking\Plugins\PhotonNetwork

If any of those files changed recently, this might be related.
Also check the .meta files and scenes.

The issue must be in the client or build.
Did you check the client's logs? Does it say anything about connecting? Does it when you put debug.log in at the respective lines of code?

Sorry, this does not match with any known issue, so all I can do is give pointers and ask questions (so far).

2016-05-11 16:43:11

Greetings again Tobias, thanks so much for taking time to read about our issue. I did not update Photon yesterday. In fact, my steps to make this happen go like this.

  1. Changed some Rigid body options on some character items and made a build. Everything works fine, make build live.
  2. Playing live build 5 minutes later and realize I forgot to set the characters starting items for inventory.
  3. Set starting characters items for inventory (nothing to do with Photon).
  4. Make build, test build, Multiplayer and Singleplayer broken, game being forced into offline mode and stuff that normally works in Offline mode is all broken (I can test against the live build made 10 minutes before the broken one).

From here I made like 5 builds, all broken, decided to revert to the day before from REPO, make build and it's still broken. I check against the REPO log and it tells me about the few items I changed, which is just some RigidBodies on items. :/ Looking at client log and there is just NO errors - just the standard stuff and nothing much on Photon. Console doesn't spam anything either when in development build. It seems like making a Debug.Log is going to be necessary to see what is going on here. Thanks for the suggestions and support!

2016-05-12 13:24:17

@Tobias - Thanks again for your suggestions. We switch back and forth between online and offline mode, and the way we were doing it was causing issues, which was the final culprit. We changed this method and everything works well again. Thanks for the support and great technology!

2016-05-13 10:21:10

Good to read you found it!
Looking forward to see more of you game :)

2020-05-24 20:55:46

Have a similar error where build break photon but it works fine in editor. I can not figure it out. We've spent 3 days trying to solve this so that we can push a new live build to steam on a project. Reverting to old version of Unity does not work either. Very strange. @Tobias

2020-07-05 01:18:28

After no connection on build Android device while editor working fine, deleting the project's "Library" folder and rebuilding worked for me.

2020-08-03 20:45:54

I'm having this issue with the sample scenes, any solution for it?

2020-08-03 21:24:39

I just Updated PUN version to 2.20.1 and it solved

2020-08-04 07:53:05

Yes, we found this too late. The issue happened in PUN v2.20 and Unity 2019.4 or higher.
It's fixed with PUN v2.20.1.

2022-01-07 02:16:19

hi sir tobias where can we download the PUN v2.20.1? thanks in advance

Back to top