Unity stuck on play.

Options
After importing latest PUN v1.91 unity got stuck after hitting play second time. It works fine with first play but after stopping and playing again it just hangs with not responding message. What might be the cause ? Is there any bug in newer version or is it because of my project size but its around 110 MB size ?

Comments

  • avimon
    Options
    I actually got it working but with .NET 4.x Equivalent. What could be wrong with .NET 3.5 ? Can someone explain?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited July 2018
    Options
    Hi @avimon,

    It's funny that .NET 4.x works well for you as it's still not considered stable for us.

    I think you're using Photon Chat and not properly disconnecting chat client.
    Try adding something like this and see if it helps:
    public class SomeMonoBehaviour : MonoBehaviour 
    {
         private void OnApplicationQuit() 
         {
               if (chatClient != null) 
               {
                    chatClient.Disconnect();
                    chatClient.StopThread(); // could be optional
               }
         } 
  • avimon
    Options
    @JohnTube Will there be any problem if I use .NET 4.x because its not working with .NET 3.5 even after your suggestion?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited July 2018
    Options
    I'm still curious to know why is Unity stuck.
    Did you try PUN demos? Photon Chat demo for instance. Do they cause the same issue?
    Did you try removing Photon calls and see if it helps?

    Will there be any problem if I use .NET 4.x
    It should work yes but as I told you, we officially do not claim it's stable yet, please report any issue to us if you find any.
  • avimon
    Options
    @JohnTube Ok. I will report to you as soon as I am done with these suggestions.