I want to build webgl output of game. Unity gives error to me in webgl platform for desktop and mobile browsers which is unacceptable to me for games. I am using free version of it.I got information that only licence version gives access to play games in all browsers of webgl platform, is it true? I want to know that how can I make it run in all browsers of devices without plugins and any extra softwares with unity.
↧
WebGl games (web app) for Browsers
↧
WebGL building FileNotFoundException does not exist
When I run a building to WebGL my test project, I always get the 3 error:
How can I overcome her?
FileNotFoundException: D:\Cloud-Google\LeoUnity\UnityTest4\Temp\StagingArea\Data\linkresult_wasm\build.wasm does not exist
System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at <599589bf4ce248909b8a14cbe4a2034e>:0)
System.IO.File.Copy (System.String sourceFileName, System.String destFileName) (at <599589bf4ce248909b8a14cbe4a2034e>:0)
UnityEditor.WebGL.WebGlBuildPostprocessor.AssembleOutput (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:644)
UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:934)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at C:/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:27)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
UnityEngine.GUIUtilityrocessEvent(Int32, IntPtr)
Build completed with a result of 'Failed'
UnityEngine.GUIUtilityrocessEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:95
UnityEngine.GUIUtilityrocessEvent(Int32, IntPtr)
↧
↧
WebGL block host
I'm building an webGL application and I'm going to host it in my website. I'm concerned about the possibility of third party users downloading my application and hosting it somewhere else.
Is there a way to block my webGL application when it's not being host by my own website domain? (just block it from being used, like closing or crashing)
↧
WebGL loading times with .NET 4.x
Hello everyone,
I have a WebGL project in Unity version 2018.2.12f1 that uses Photon Realtime Multiplayer.
I have been told by the Photon guys I should switch my "Scripting Runtime Version" from .NET 3.5 to .NET 4.x for security reasons.
Once I've made the switch, the project started loading very slowly. After the default loading screen there are now an additional 30 seconds of just an empty black screen before the first scene loads.
This is not the case when I use .NET 3.5.
Does anyone know what is causing this additional loading time and how I can bring it back down while still using .NET 4.x?
Thanks
↧
WebGL Image Quality Issues
I'm working on a game which is supported on WebGL. The game is built with a reference resolution of width and height 1152x2048 and works fine for mobile platforms. On WebGL, the game has a resolution of 650x650, and all of the images become aliased and pixelated. I'm looking for a way to improve image quality for WebGL.
1. I tried increasing the WebGL canvas size to make the game resolution is bigger. It improves the quality of the picture, but I can't make the canvas big enough because it will not fit into the web-page. This option is not the right solution for my case.
2. Mip Maps for textures doesn't show good results, the textures become less aliased, but they are blurry.
3. Another thing I'm thinking about is making a smaller version of textures and use them for screens with small resolution. It's a time-consuming option, so I wonder if there is a simple solution.
Is there any other way to make a game look better on a small resolution?
Also, is there a way to force Unity to render the game with a bigger resolution than the size of WebGL canvas element in HTML page?
↧
↧
How can I bypass CORS with Unity WebGL?
Hello, I am trying to read and write from a file. I uploaded my WebGL build to Itch.io. I have my server running on my Mac Terminal, it is at localhost:9000. When I run the game on Itch.io I get this error:
Access to XMLHttpRequest at 'http://localhost:9000/getlevellist.php' from origin 'https://v6p9d9t4.ssl.hwcdn.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
My C#:
UnityWebRequest www = UnityWebRequest.Get("http://localhost:9000/getlevellist.php");
yield return www.SendWebRequest();
My PHP:
How can I resolve this and bypass CORS? Thank you in advance.
↧
UNITY WEBGL CAN'T CHANGE CAMERA DEVICE FROM CODE
Hello, i'm working with WebGL and i can't set the rear camera in my android device. For default, Unity WebGL sets the front camera.
I found a method to change the camera but it's compiling the project in Development build and change the code from my buid.asm.framework as this posts suggest https://forum.unity.com/threads/device-camera-in-webgl.523253/
The problem it's that the Development build mode it's too longer for deploy. So i need some solution to change the camera device or access to build.asm.framework without development build.
Best,
Pablo
↧
I can't import project tiny in Unity 2019
I am using Unity version 2019.2.6f1.
This is the error that I get when I import Project Tiny:
Library\PackageCache\com.unity.tiny@0.16.1-preview\Unity.Serialization.Properties\SerializedObjectViewPropertyBag.cs(192,33): error CS0246: The type or namespace name 'ICollectionElementGetter<>' could not be found (are you missing a using directive or an assembly reference?)
![alt text][1]
![alt text][2]
[1]: /storage/temp/146981-tiny-error.png
[2]: /storage/temp/146982-tiny-error-2.png
↧
Is it possible to adjust Unity BuildTools files during an Unity Cloud Build
In our project we had to adjust some code in the Unity BuildTools folder to fix some dpi problems we got in the webgl build. We had to adjust the following file: [UNITY_PATH]\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\lib\SystemInfo.js
We would like to use the Unity cloud build service, but our question is: are we able to adjust those Unity files during an cloud build?
↧
↧
Setting up my website/server to host WebGL
How can I definitively set up my own website to host WebGL HTML5 content?
I've found lots of guides for other sites to host WebGL content on (simmer.io), using 3rd party services like AWS or Firebase, offline local hosting, or hosting via Google Drive or Dropbox. But I'm struggling to find resources on simply setting up my own website and server to host WebGL files.
I'm using iPage, and have full access to edit my .htaccess and site directories. My server is Debian if that matters.
If possible, I'd also like to host WebAssembly files.
Thanks!
↧
WebGL audio and Slider Interaction
First, I am a total newbie. Second, I am trying to get an audio file position in time to be controlled by a slider UI element. When previewing locally everything works fine. When publishing to WebGL and viewing online I am experiencing substantial audio crackling. I have traced it to the last line of the below code which is commented out. Can anyone recommend a better way to link the slider value and audio time? Is it that it is being constantly updated?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class demo : MonoBehaviour
{
AudioSource audios;
Slider slider;
public AudioClip song;
void Start()
{
audios = GetComponent();
slider = GetComponent();
audios.clip = song;
audios.Stop();
slider.minValue = 0;
slider.maxValue = song.length;
}
void Update()
{
slider.value = audios.time;
}
/*
public void MovePosition()
{
audios.time = slider.value;
}
*/
}
↧
Add .NET Socket capability to WebGL.
As noted in the documentation here:
https://docs.unity3d.com/Manual/webgl-networking.html
Direct socket connections have been left out for "security" reasons. This is outrageous. Direct socket connections are FAR safer than any web based HTTPS call. I have an entire suite of direct socket servers, secured, that eliminate every single web based vulnerability known today. This is sorely needed in the webgl environment.
My main concern is the fallacy of the statement in the manual noted above. This statement is factually false. It does not end there.
As it is right now, UnityWebRequest doesn't work either. So webgl is at best a single player non-networking solution. It barely works as it is. I am appalled at the lack of updates to this platform and the sheer difficulty in deploying and running it. While everyone I am sure has spent DAYS getting it to work, customers are NOT going to tweak their browsers just so they can run webgl.
At this point, it has become a business to business tool, but without networking it is effectively useless and with the poor networking implemented it is an enormous time sink for developers.
My strong recommendation is to add direct socket, and other .NET, capability immediately.
↧
Upscaling in fullscreen mode in WebGL build. How to disable it?
Hi! I am getting an upscale image when running my WebGL build on mobile device or using desktop Chrome browser with mobile emulator mode.
It is strange, but this upscale effect appears only on mobile browsers, on desktop everything looks fine.
Also, I am getting an error message in browser console when changing to fullscreen:
WebGL: INVALID_OPERATION: drawBuffers: BACK or NONE
How to fix it? I've already tried:
1) Switching from WebGL 2.0 to WebGL 1.0
2) Switching color space (linear/gamma).
3) Disabling MSAA.
4) Changing default canvas resolution.
Example:
![alt text][1]
![alt text][2]
[1]: https://downloader.disk.yandex.ru/preview/7d271623a49a2e24425d4f52efd839d99a62109d26f3e6abfb5d82aefe89a934/5da087d3/QQzZhZnS2XQLw8RpvWNqjXAoIV0B0HO_8gckAGJCFMC_bV15N7kycSM1QncbiG7BwkIbzdhSo1JtcLdCw9P1TA%3D%3D?uid=0&filename=2019-10-11_12-26-09.jpg&disposition=inline&hash=&limit=0&content_type=image%2Fjpeg&owner_uid=0&tknv=v2&size=1920x990
[2]: https://downloader.disk.yandex.ru/preview/fdfc585a0464e604cb09ea26a1a9f53194ad3056044bc1699f8d9be955e25526/5da08820/jel0b5zUFSNp8MxZ30Op4SWrUQboNACQ_WK3bW8yA_Poftg6qe2bXnFoTXTxtP7gofsqec4vygNA8TT6JJ_44g%3D%3D?uid=0&filename=2019-10-11_12-26-59.jpg&disposition=inline&hash=&limit=0&content_type=image%2Fjpeg&owner_uid=0&tknv=v2&size=1920x990
↧
↧
WebGL freezes until memory is allocated (20 seconds)
My game creates 10,000 entities or so during runtime that are all rendered on screen. In the WebGL build when they are created the game freezes for about 20 seconds, and then after this period it runs totally smoothly. I am guessing this is the automatic memory heap allocation catching up. I already include:
PlayerSettings.WebGL.linkerTarget = WebGLLinkerTarget.Wasm;
PlayerSettings.WebGL.threadsSupport = true;
PlayerSettings.WebGL.memorySize = 512;
How can I avoid this crashing period? Your help would be greatly appreciated. If you want to see this live just go to "www.superballs.graphics" (has to be Chrome browser), and click and hold on the game screen. You will notice that every once in a while as objects are created it crashes, and then after runs smoothly.
Note: GPU instancing is required.
↧
Default WebGL fullscreen button not working in Firefox
I've built and embedded a WebGL project on my website. On Chrome and Edge the default fullscreen button works fine. I don't know if this is a common issue, an issue with my project (which has no scripts relating to fullscreen mode), an issue with the website/html, or if there's an issue with the build settings.
Has anyone else had this issue?
↧
A* Pathfinding Project works fine in editor, but not in WebGL build
My enemies using the A* Pathfinding Project from https://arongranberg.com/astar/, work as expected in the editor, but in a WebGL build they stand still doing nothing.
If anyone has an idea of what could be wrong, that would be much appreciated.
↧
How do I include System.CodeDom in WebGL?
When trying to compile my WebGL project, I get this error:>error CS1069: The type name 'CodeCompileUnit' could not be found in the namespace 'System.CodeDom'. This type has been forwarded to assembly 'System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' Consider adding a reference to that assembly.
----------
I have already tried changing Scripting Runtime Version and API Compatibility Level to 4.x, but I still cannot compile my project. I think I read somewhere that SystemCodeDom is NOT included for WebGL because there is no way to make dynamic code generation work on WebGL.
https://answers.unity.com/questions/58931/problem-with-systemcodedom-in-c.html
The project actually compiles fine on **Android** and **iOS**.
----------
My questions are:
1. **Is it possible to manually add System.CodeDom directly to a WebGL project**?
2. **Where can I see all the possible System namespaces that can be used for WebGL**?
↧
↧
Project Tiny compatibility with the Cordova Framework
We are working with a Broadcaster, who have a html5 based app, with a lot of kids games.
The app is made using the Cordova web-app application framework (js based).
We have found a compatibility bug when trying to run a Project Tiny project, through their app.
It starts throwing errors, when the cordova framework starts loading/executing (even before the game code starts loading).
![alt text][1]
Cordova does mention anywhere, that it does not support stack tracing. Or that it uses managed exceptions. But that does offcause not means, that it is not the case(s).
So the question is, whether this is a well know compatibility bug - Project Tiny will never by able to run inside the framework at all?
-or if there is a work-around?
-or if there is a upcoming fix?
- or if maybe never versions of the Cordova framework might fix this?
Any pointers, would be really great.
[1]: /storage/temp/147463-pasted-image-0.png
↧
WebGL to cache Data before the first run
Hi,
We have a presentation with a few pages before WebGL page starts that user is going through, so we would like to initiate download and caching of the large App.data.unityweb file while on the very 1st page of that presentation.
Unity WebGL doc: "Data caching Enable this option to automatically cache your contents Asset data on the user’s machine so it doesn’t have to be re-downloaded on subsequent runs."
And it is working after the 1st run. Is it possible for WebGL to cache Data App.data.unityweb before the first run?
Thanks a lot!
↧
WebGL crash on instanitate
Hi, i'm having problem with a crash issue that seemingly comes from during instantiation, on WebGL platform.
I'm using Unity 2018.4.7f1, with just WebGL 1.0 for graphic API, and WebAssembly for linker target.
Built as Development build.
The error I got from Chrome, is always "Memory access out of bounds"
![alt text][1]
Here's is my code snippet
UnityEngine.Debug.Log("ZR 1.8: " + (template != null));
var go = MonoBehaviour.Instantiate (template);
UnityEngine.Debug.Log("ZR 2: " + GetType());
Notice that it never went past to "ZR 2" log, and the crash comes after "ZR 1.8".
"template" is a GameObject that's loaded from an AssetBundle, and it doesn't seems to be null.
So I start trying to remove the children objects in the "template" and rebuild the bundle.
And I have reduce it into an empty game object. Its still crashed with the same error.
![alt text][2]
I have run out of idea on how to debug this issue. It would be helpful if anyone can spot my mistake, or direct me on how to solve this problem.
Thanks in advance.
[1]: https://answers.unity.com/storage/temp/147619-chrome-error-msg.png
[2]: https://answers.unity.com/storage/temp/147620-empty-gameobject.png
↧