Hello everyone,
I am new to Photon/PUN and also quite new to unity. I have a problem using PUN 2 and could not find a solution up to now:
I just wanted to test if PUN 2 works also in WebGL Builds, as far as I know it should. But I am not able to get a working WebGL Build with PUN 2. I tried it also with the Demos (especially the SlotCar Demo) you can get with PUN (to be sure, that nothing in my Project creates the problem), but even then I can't get a working WebGL Build. When I build the Demo as Windows Standalone, everything works fine and I also can get a connection to the server from different clients.
When I want to build WebGL, I first got a build, but it never left the Unity/WebGL loading screen. And now after I updated Unity and PUN 2 to the current version I am not even able to get a build.
I give you a short history of what I tried:
When I open an empty unity (3D) project, I already get a warning:
after importing PUN 2, there are several warnings:
after loading the SlotCar Demo Scene, there is another warning:
If I build the Demo now as Windows Standalone, everything works fine despite the several warnings.
If I switch the platform to WebGL i get another 3 warnings:
now, if I click on "Build" I get another 4 messages:
Do you know what is wrong? Why is unity not even able to build the Demo of PUN 2 in WebGL?
As I already said I have the newest version of Unity and PUN 2.
I hope my request is not confusing or stupid.
I am new to Photon/PUN and also quite new to unity. I have a problem using PUN 2 and could not find a solution up to now:
I just wanted to test if PUN 2 works also in WebGL Builds, as far as I know it should. But I am not able to get a working WebGL Build with PUN 2. I tried it also with the Demos (especially the SlotCar Demo) you can get with PUN (to be sure, that nothing in my Project creates the problem), but even then I can't get a working WebGL Build. When I build the Demo as Windows Standalone, everything works fine and I also can get a connection to the server from different clients.
When I want to build WebGL, I first got a build, but it never left the Unity/WebGL loading screen. And now after I updated Unity and PUN 2 to the current version I am not even able to get a build.
I give you a short history of what I tried:
When I open an empty unity (3D) project, I already get a warning:
Assembly for Assembly Definition File 'Packages/com.unity.collab-proxy/Tests/Editor/Unity.CollabProxy.EditorTests.asmdef' will not be compiled, because it has no scripts associated with it.
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget, String[])
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget, String[])
after importing PUN 2, there are several warnings:
Unity is only able to load mdb or portable-pdb symbols. Assets/Photon/PhotonLibs/Metro/Photon3Unity3D.pdb is using a legacy pdb format.
UnityEngine.Debug:LogWarning(Object)
Microsoft.Unity.VisualStudio.Editor.VisualStudioEditor:SyncIfNeeded(String[], String[], String[], String[], String[]) (at Library/PackageCache/com.unity.ide.visualstudio@2.0.2/Editor/VisualStudioEditor.cs:154)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
Unity is only able to load mdb or portable-pdb symbols. Assets/Photon/PhotonLibs/netstandard2.0/Photon3Unity3D.pdb is using a legacy pdb format.
UnityEngine.Debug:LogWarning(Object)
Microsoft.Unity.VisualStudio.Editor.VisualStudioEditor:SyncIfNeeded(String[], String[], String[], String[], String[]) (at Library/PackageCache/com.unity.ide.visualstudio@2.0.2/Editor/VisualStudioEditor.cs:154)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
Unity is only able to load mdb or portable-pdb symbols. Assets/Photon/PhotonLibs/Photon3Unity3D.pdb is using a legacy pdb format.
UnityEngine.Debug:LogWarning(Object)
Microsoft.Unity.VisualStudio.Editor.VisualStudioEditor:SyncIfNeeded(String[], String[], String[], String[], String[]) (at Library/PackageCache/com.unity.ide.visualstudio@2.0.2/Editor/VisualStudioEditor.cs:154)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
UnityEngine.Debug:LogWarning(Object)
Microsoft.Unity.VisualStudio.Editor.VisualStudioEditor:SyncIfNeeded(String[], String[], String[], String[], String[]) (at Library/PackageCache/com.unity.ide.visualstudio@2.0.2/Editor/VisualStudioEditor.cs:154)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
Unity is only able to load mdb or portable-pdb symbols. Assets/Photon/PhotonLibs/netstandard2.0/Photon3Unity3D.pdb is using a legacy pdb format.
UnityEngine.Debug:LogWarning(Object)
Microsoft.Unity.VisualStudio.Editor.VisualStudioEditor:SyncIfNeeded(String[], String[], String[], String[], String[]) (at Library/PackageCache/com.unity.ide.visualstudio@2.0.2/Editor/VisualStudioEditor.cs:154)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
Unity is only able to load mdb or portable-pdb symbols. Assets/Photon/PhotonLibs/Photon3Unity3D.pdb is using a legacy pdb format.
UnityEngine.Debug:LogWarning(Object)
Microsoft.Unity.VisualStudio.Editor.VisualStudioEditor:SyncIfNeeded(String[], String[], String[], String[], String[]) (at Library/PackageCache/com.unity.ide.visualstudio@2.0.2/Editor/VisualStudioEditor.cs:154)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
after loading the SlotCar Demo Scene, there is another warning:
Scene 'PunCockpit-Scene' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
To add a scene to the build settings use the menu File->Build Settings...
UnityEngine.SceneManagement.SceneManager:LoadScene(String, LoadSceneMode)
Photon.Pun.Demo.Cockpit.<Start>d__6:MoveNext() (at Assets/Photon/PhotonUnityNetworking/Demos/PunCockpit/Scripts/ThirdParty/PunCockpitEmbed.cs:53)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
To add a scene to the build settings use the menu File->Build Settings...
UnityEngine.SceneManagement.SceneManager:LoadScene(String, LoadSceneMode)
Photon.Pun.Demo.Cockpit.<Start>d__6:MoveNext() (at Assets/Photon/PhotonUnityNetworking/Demos/PunCockpit/Scripts/ThirdParty/PunCockpitEmbed.cs:53)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
If I build the Demo now as Windows Standalone, everything works fine despite the several warnings.
If I switch the platform to WebGL i get another 3 warnings:
Assets\Photon\PhotonRealtime\Code\PhotonPing.cs(449,17): warning CS0618: 'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'
Assets\Photon\PhotonRealtime\Code\PhotonPing.cs(456,35): warning CS0618: 'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'
Assertion failed on expression: 'ins.second || ins.first->second == targetHash || (ins.first->second == CircularDependencyHash() && !targetHash.IsValid()) || GetPathFromAssetGuidV2(key.GetGUID()).ends_with(".cs")'
Assets\Photon\PhotonRealtime\Code\PhotonPing.cs(456,35): warning CS0618: 'WWW' is obsolete: 'Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features'
Assertion failed on expression: 'ins.second || ins.first->second == targetHash || (ins.first->second == CircularDependencyHash() && !targetHash.IsValid()) || GetPathFromAssetGuidV2(key.GetGUID()).ends_with(".cs")'
now, if I click on "Build" I get another 4 messages:
Assets\Photon\PhotonLibs\WebSocket\WebSocket.cs(5,7): error CS0246: The type or namespace name 'WebSocketSharp' could not be found (are you missing a using directive or an assembly reference?)
Error building Player because scripts had compiler errors
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x0027c] in <d1bec46880064709a5e713ad543e6d96>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <d1bec46880064709a5e713ad543e6d96>:0
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Error building Player because scripts had compiler errors
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x0027c] in <d1bec46880064709a5e713ad543e6d96>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <d1bec46880064709a5e713ad543e6d96>:0
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Do you know what is wrong? Why is unity not even able to build the Demo of PUN 2 in WebGL?
As I already said I have the newest version of Unity and PUN 2.
I hope my request is not confusing or stupid.