#๐ŸŒโ”ƒweb

1 messages ยท Page 1 of 1 (latest)

jade valve
#

greetings. I have a UI sprite that shows F11 enables full screen. When in full screen, i want to swap the sprite to show that F11 leaves full screen.
Unfortunately, the code only works when NOT in full screen. When in full screen, the sprite swapping doesn't work.

I imagine this is due to the browser kind of owning F11

Is my best solution to code this into the index.html somehow?

orchid bridge
#

am i legally allowed to alter the template of the Unity WebGL text? (replacin it with something else) and changing the look so it doesn't show a Unity logo - apart from game startup?

charred briar
charred briar
#

I'm suspecting there may be an event

jade valve
charred briar
#

You are definitely right about the other option, and sending a message using JavaScript from the web to the Unity blob

acoustic plover
#

Is there a timeline for when WebGPU will be available to use?

sweet oriole
wheat wadi
#

Anybody who knows how to release mesh memory on WebGL?
I used Resources.UnloadUnusedAssets(); for releasing the mesh memory. But this is not working in WEBGL. And this makes out of memory error.

nocturne oracle
#

Hi guys i keep getting this when i play my game on itch.io how to fix

wet grail
drifting dove
dusty mauve
#

Hey I got a Problem where Unity Wasm wont run a Methode inside a Thread or not get there. In Editior everything works fine... Do I have to activate Multithreading or anything?

sweet oriole
dusty mauve
#

Mhm what can I do I use the edge browser

#

And I used System.Threading

sweet oriole
#

Remove use of System.Threading

dusty mauve
#

Well is there another Unity way of threading

#

I need it for my UDP connection

sweet oriole
#

Do you just need it for async stuff or do you actually need threads?

dusty mauve
#

Yea I do need threads

#

I got a websocket connection and a udp connection

sweet oriole
#

Why do you need a thread for that?

#

Your UDP connection is also probably not going to work

dusty mauve
#

Why?

sweet oriole
#

I don't think browsers really have network APIs for UDP connections

dusty mauve
#

How would sockets work then

#

I mean to support tcp but not udp would be pretty weird

sweet oriole
#

I don't think you can just use TCP sockets either

#

Afaik you need to go through browser's networking APIs, like WebSockets or WebRTC.

dusty mauve
#

:/

sweet oriole
#

The realtime browser networking you see today is most likely WebSocket TCP.

dusty mauve
#

I hate web development

burnt heart
#

morning all! hope everyone is well ๐Ÿ™‚

having an issue with hosting my WebGL game using NGINX. I have another game hosted with the exact same proxy setup, but I'm getting this on my newest game. The header is set in the proxy settings, and it's all the exact same as my previous games proxy, so not sure what's going on. Can someone shed some light on this please?

astral wave
burnt heart
#

I had to enable decompression fallback to resolve this

#

Fixed as of like 11 hours ago, just forgot to remove post or say lol

astral wave
#

then your build wont have wasm. most likely you stil have old js for loading your files in index.html

burnt heart
#

Thanks tho

astral wave
#

oh nwm then ๐Ÿ˜„ glad it works ๐Ÿ˜„

burnt heart
jolly yoke
#

Hey guys for the unity play, I'm trying to tag the tutorial I used for the project I created so others can go to it if they want to try making their own.

The create and publish builds tutorial says you can tag tutorials but I'm not seeing where. I tried doing it where you can add asset packs but doesn't seem to work. Is there a different space?

#

it seems like the assets i'm trying to tag arent saving either - I hit save down at the bottom but doesn't show up on the project page

sweet oriole
arctic rose
#

Did you check the console?

#

ok then

#

you don't say

#

show what they are

orchid bridge
#

Yeah, this server requires you to show what they are.

#

If you're still having trouble with them.

high patrol
#

What does that multithreading checkbox setting enable you to do then?

#

I'm assuming they're still working on error handling and haven't opened up anything in system.threading yet

astral wave
#

multithreading where?

sweet oriole
astral wave
sweet oriole
#

Open tabs from a previous convo I had on code-advanced ๐Ÿ˜„

silk brook
#

now I really need to know how to set a full screen on default
not the full screen button like F11
but fit in on the browser window ...

sweet oriole
#

You do it the same way you resize other divs in HTML. Unity by default matches the whatever size the canvas ends up having.

sweet oriole
# silk brook but maybe here ?

Settings involving specific numbers are probably not relevant if you want to scale based on something else, like window size.

#

Edit the HTML output

silk brook
sweet oriole
#

IIRC you should see style="width: ..." stuff in the default output, so my tip here would be that you can replace px values with % values.

#

Browser inspector views are great for finding out (and modifying for testing) what values are being applied to your elements.

charred briar
sweet oriole
charred briar
#

Fair point, I misread it as trying to bypass needing to press the key

#

And yup, width and height 100% on the canvas does work with Unitys WebGL (not with Phaser though which is interesting)

sweet oriole
silk brook
silk brook
sweet oriole
#

To be clear, meant the browser canvas system, not the Unity's canvas system.

sweet oriole
silk brook
sharp bramble
#

Hello, i am trying to build for webgl this is the first time i am doing that and have an error right now Unable to parse Build/PTBTD.framework.js.br! This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: br" present. Check browser Console and Devtools Network tab to debug.
What are the things i have to change for it to work?

sweet oriole
sharp bramble
#

i don't think so, where can i find these settings?

sweet oriole
#

Which settings?

sharp bramble
#

like the hosting configuration

sharp bramble
#

I got it working with the build size settings

sweet oriole
sharp bramble
#

I am hosting it on itch.io but it works now

jolly yoke
#

hey guys having an issue publishing my next project from the learn platform.

Gets stuck at 90%. Tried disabling compression on the player as per guide on searching about this issue, compression was already off tho. Any other ideas why loading the game gets stuck at 90%?

Seems to run fine on localhost

https://play.unity.com/p/webgl-builds-227847/

Unity Play

The place for aspiring game creators to share their latest WebGL creation. Gain inspiration through ongoing showcases and find thousands of FPS, Karting, 2D Platformer and other creations with Unity. No experience needed, just jump in for the chance to be featured!

quiet lagoon
#

Any way to disable all these warnings in the console?

astral wave
#

I am not 100% sure but maybe these two?

#

in player settings in build options

quiet lagoon
astral wave
#

is build developer mode or not?

quiet lagoon
#

no, release :/

sweet oriole
vivid trench
#

Hello. I'm sure this has been asked to death but I couldnt find good info:

whats the webgl version of this statement?
path = EditorUtility.OpenFilePanel("Select an image", "", "png,bmp,jpg");

I just need to let the user select a file. doesn't need to go to a server, it's all client side.

Thank you

sweet oriole
fluid lily
#

Hey everybody, first time using unity for webgl. If you have a game that runs in a website and needs to run complex javascript code that affects the server state. How do you set it up so you can test from the editor without having to make builds all the time?

orchid bridge
#

My WebGL build has been loading for 30 minutes
Last time I made a build it took about 8 minutes
In the task manager I noticed that the build folder is not responding

I tried to cancel it but that isnโ€™t loading either
Should I force end it? Thatโ€™s not going to corrupt data or something is it?

For my last build one of the materials wasnt appearing and I found a tip to turn on Decompression Fallback
I havenโ€™t tested if this works yet

I found another tip that said set compression format to disabled, is this good advive?

high patrol
river tinsel
#

My WebGL build keeps failing with these errors : https://pastebin.com/TGjuGs7p
It works fine on windows standalone however I keep getting the same error here.
I've tried changing the project/ build path, restarting my PC/Unity, reinstalling Unity (2021.3.7).
Anyone know what I could be missing?

vivid trench
#

Hi guys.

So i got this jslib file with a function I want to call, I call it from my C# code and get EntryPointNotFoundException: myFunctionName

What am I missing? o.0

arctic rose
#

ยฏ\_(ใƒ„)_/ยฏ

#

Show code

vivid trench
#

Assets/Plugins/ImageUploader.jslib

var ImageUploaderPlugin = {
  ImageUploaderCaptureClick: function() {
    if (!document.getElementById('ImageUploaderInput')) {
      var fileInput = document.createElement('input');
      fileInput.setAttribute('type', 'file');
      fileInput.setAttribute('id', 'ImageUploaderInput');
      fileInput.style.visibility = 'hidden';
      fileInput.onclick = function (event) {
        this.value = null;
      };
      fileInput.onchange = function (event) {
        SendMessage('Canvas', 'FileSelected', URL.createObjectURL(event.target.files[0]));
      }
      document.body.appendChild(fileInput);
    }
    var OpenFileDialog = function() {
      document.getElementById('ImageUploaderInput').click();
      document.getElementById('canvas').removeEventListener('click', OpenFileDialog);
    };
    document.getElementById('canvas').addEventListener('click', OpenFileDialog, false);
  }
};
mergeInto(LibraryManager.library, ImageUploaderPlugin);
#

Assets/Scripts/Canvas/CanvasScript.cs

using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
using UnityEngine.Networking;
using UnityEngine.EventSystems;
 
public class CanvasScript : MonoBehaviour {
    
    [DllImport("__Internal")]    
    private static extern void ImageUploaderCaptureClick();
 
    IEnumerator LoadTexture (string url) {
        UnityWebRequest image = UnityWebRequestTexture.GetTexture(url);

        yield return image;

        if(image.result == UnityWebRequest.Result.ConnectionError || image.result == UnityWebRequest.Result.ProtocolError)
        {
            Debug.Log(image.error);
        }
        else
        {
            Texture myTexture = ((DownloadHandlerTexture)image.downloadHandler).texture;
            
            Debug.Log(myTexture.ToString());
        }
    }
 
    void FileSelected (string url) {
        StartCoroutine(LoadTexture (url));
    }
 
    public void OnButtonPointerDown (BaseEventData data) {
        ImageUploaderCaptureClick ();
    }
}
#

the 2nd to last line of this code gives the error: EntryPointNotFoundException: ImageUploaderCaptureClick

charred briar
#

The second last line of code is a }

#

And you posted two different code snippits.

#

But that is saying whatever DLL you are using doesn't have that function in it - or at least not in an accessible way

#

I'd venture a guess it's because ImageUploaderCaptureClick is not explicitly a function

#

The other possibility is the plugin isn't set to WebGL

strange hollow
#

How do I use mirror networking with webgl? Are there any tutorials? Cause I can't find anything.

indigo sail
#

Hi. How can I split data from build.data.gz? I need to reduce file size to 200 mb for itch download

sweet oriole
silk brook
jolly yoke
silk brook
#

did you build it using Unity WebGL Publisher ? @jolly yoke
since no one use brutli on a stand alone WebGL build

jolly yoke
sweet oriole
#

Pretty sure WebGL Publisher exists just to easily push builds to Unity Play.

worn blade
#

Hi! I'm building to webgl but i'm struggling

#

i have theses files

#

what do I have to upload ?

austere meteor
#

Im trying to run a webgl game on itch, but when I run it it shows this error:
Unable to parse Build/SpecialKingWebgl.framework.js.br! This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: br" present. Check browser Console and Devtools Network tab to debug.
In the console i get this error:
Uncaught SyntaxError: Invalid or unexpected token (at SpecialKingWebgl.framework.js.br:1:2)

#

It doesent get an error when running it on local host

half parrot
#

so I spent today writing a music management system, got it all working in editor, worked out most of the bugs... made a webGL build, and its having some weird issues in the browser version, and I have no idea how to even begin troubleshooting them

#

how do you debug for issues that are only happening in the webGL build and not in the editor

#

like, I know this doesnt help solve the issue at all, but here is what I'm dealing with:

In the webGL build, if I start the game, then return to title screen, then load back in the game... the music volume is 0... if I go into my pause menu and adjust the music volume, it instantly comes back. This is consistent and reproducable 100% of the time

but this does not happen in editor, only in the webGL build

astral wave
#

Unity people who worked on this

WebGL: Fixed connection between the WebGL player and the profiler. (UUM-798)

WebGL: Fixed player connection used when running PlayMode tests on WebGL. (UUM-1170)

THANK YOU โค๏ธ waited for this for so long, best update ever!

half parrot
#

OH, I know what the issue is... and I think I know how to address it

its cause I'm using a dictionary in a scriptable object with an <enum, AudioClip> pairing... thats all well and good, but in order to initialize it properly and make it work in editor, I am populating the dictionary OnValidate

I need to copy that code over to Awake so it runs when the game starts in browser

#

I hope that fixes it... but I'm not 100% sure it will

cosmic crown
#

is there a way to have the browser ignore ctrl+F ?

astral wave
# cosmic crown is there a way to have the browser ignore ctrl+F ?

Spread the love Related Posts How to Disable All Mouse Clicks on a Page with JavaScript?Sometimes, we want to disable all mouse clicks on a page with JavaScript. In thisโ€ฆ How to Disable Text Selection with JavaScript?Sometimes, we want to disable text selection with JavaScript. In this article, weโ€™ll look atโ€ฆ How to pass variable [โ€ฆ]

cosmic crown
#

@astral wave thanks, i did exactly that in my webgl template

#

and it worked

cobalt radish
#

I want to upload my unity project to itch but my webgl build seems to require a webserver to run

#

any solution to this?

#

somehow I fixed it

#

I dont know how but I got it working

burnt heart
#

Hi, I'm trying to build for WebGL and all of a sudden I'm getting this error. I've tried a clean build and the same thing is happening

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at Unity.IL2CPP.CodeWriters.ChunkedMemoryStream.Seek(Int64 offset, SeekOrigin origin)
   at Unity.IL2CPP.CodeWriters.InMemoryGeneratedMethodCodeWriter.Write(IGeneratedMethodCodeStream other)
   at Unity.IL2CPP.SourceWriters.SourceWriterBase`2.FlushStream(GlobalWriteContext context, IGeneratedMethodCodeStream stream, NPath filePath)
   at Unity.IL2CPP.Contexts.Scheduling.Streams.FileLevelParallelStreamManager`3.WorkerWriteItemsToFile(WorkItemData`2 data)
   at Unity.IL2CPP.Contexts.Scheduling.PhaseWorkScheduler`1.WorkerLoop(Object data)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)```
fathom python
#

which canvas size I should set for a 16:9 ratio?

burnt heart
#

hi, im trying to execute HTTP requests from a webgl build and getting this. It works fine in the editor, but not when built

burnt heart
#

Anyone able to help me?

burnt heart
orchid bridge
#

Guys im exporting a WebGL app for integrate with a platform named Adform, when i import my app this cast an error

orchid bridge
#

Or can i replace the loader.js with another method?

river plaza
#

uploaded a thing to itch io on 2021.3.8f1. there is no compression enabled

river plaza
#

any help?

astral wave
# river plaza any help?

well it states that you are trying to run compressed build, which is compression. In player options:

  1. disable compression, no gzip or brotli.

  2. Enable decompression fallback

  3. Check your index.HTML file. you might be loading old Build files instead of new build file\s.

river plaza
astral wave
rare kettle
#

Hey everyone! I'm trying to get a CSV generated from my Unity project and push it to the React website the Unity project is located on. Currently, I have the file written to Application.persistentDataPath

#

Any recommendations for getting it to the Javascript part?

#

I'm using React-Unity-Webgl to render the Unity part

burnt heart
#

Hi, I'm hosting a WebGL game on a HTTP server, trying to use UnityWebRequest to access a HTTP API (Both were HTTP for testing). I'm getting this error whenever the game makes a call.

#

can somebody lend me a hand with this please? I've asked in about 3 servers now over the course of this week ๐Ÿ˜ฆ

twilit wigeon
#

I tested out building my game for WebGL and noticed that the volume level settings for the audio clips weren't being used. All audio clips are playing back at full volume.

twilit wigeon
indigo sail
#

Hi. I am trying get window properties if them exist. For example:

mergeInto(LibraryManager.library, {
    getWindowParams: function() {
        return window?.innerHeight
    }
});```
But if I use `?.` build fails.
Is there solution of this problem? Unity version 2021.3.6f1
arctic rose
#

In what situation would window not exist?

indigo sail
#

I write it for example

#

Real case is another

arctic rose
#

Well it would be nice if you asked about the real case instead of an imagined one

#

Is the variable you're trying to check a global variable?

indigo sail
#

I got build error in any situation when I use ?.

arctic rose
#

Yes, you said that. You can't use the ?. operator then.

orchid bridge
#

guys please i need help with this error

#

is for a job

orchid bridge
#

Well, i finally solved it, i will explain below if someone have the same issue:
i think that error occurs because is not compatible with HTTPS or HTTP Protocol and rules that have the Platform
so solution is simple: Upload to the platform a html that contains an iframe tag with the source of WebGL game, calling from a personal server

#

The platform that i tried to upload the source is named "Adform"

silk brook
#

how come it's not compatible ? @orchid bridge

jolly flare
#

hello guys i did a webgl build and uploaded a game to my website, and had issues, I can play the game on Firefox, and Microsoft Edge, but not on Chrome ><

jolly flare
#

addons?

#

for the browser itself? i dont think im using any

#

eh i only had 2. some google documents thing and a google meet thing. i removed them both just in case

#

it just shows a grey screen. and nothing else

jolly flare
#

if i upload it to itch.io it can be viewed, but not on my personal website ><

sweet oriole
#

Yea browser addons. Try to make sure you are clearing your cache? Perhaps there is some cache control issue?

#

What do you have in browser console?

jolly flare
#

let me check

#

ok cool, yeah i saw an option for "allow unsafe code" or something, and checked it now its working just fine.

#

Ok so my next issue, i upgraded to unity 2022 and it says that it supports the mobile keyboard when you select an input field. i cant find the API to enable the keyboard when the input field is selected, does anyone know where i can find it?

arctic rose
#

There is no API. The keyboard opens automatically.

jolly flare
#

it is not ๐Ÿ˜ฆ

jolly flare
#

Unity uses the Text mesh pro input fields by default, calling the old input fields "legacy". could that have something to do with it?

charred briar
#

Is 2022 out of beta?

#

Might just be a half baked feature in 2022 :)

jolly flare
#

*shrugs idk. i was just reading that they just integrated the mobile keyboard functionality with 2022 so i upgraded the project.

proud owl
#

If I was to make a small webgl game, how/where could I publish the game to make an ios user test it?

burnt heart
#

hi, getting this error on my built game.
call works completely fine in editor and using a REST client like Postman

#

CORS is enabled on the API too

#

using UnityWebRequest

arctic rose
#

Check the Network tab and see what it sends

tranquil sable
#

First time exporting to WebGL, deadline of the game jam is in <4hr
Anyone that knows what's wrong?

\

#

Please ping me if you have an answer!

tranquil sable
#

Got it fixed by doing the build uncompressed

dim spade
#

Does anybody here know how to stop unity WebGL builds from automatically hiding the mouse on any key inputs?

#

I'm using the new input system if that helps

arctic rose
#

It's OS/browser behavior, I don't think you can disable it

astral wave
#

I am sure that is not the case. I am using webgl and mouse is not hidden regardless of what you click. Maybe you are using starter assters first or third person character controller? as hiding mouse is a feature of them. Normaly mouse is not hidden

mossy hamlet
#

Hi ! Does anyone knows why some users have these errors? I try to upload it on itch.io and same thing as my server. Several browsers tested with no luck. I don't have this error on my side so I can't really reproduce it...

pseudo sundial
#

i am having a issue when i build my game for webgl the sprite image of player gets invisible but the game works perfect on windows and linux

quiet lagoon
arctic rose
astral wave
arctic rose
#

nobody said anything about clicking

astral wave
# arctic rose nobody said anything about clicking

on any key inputs. How it is not click. Click is as key input as keybord....? If you game have disabled mouse, aka locked, clicking with mouse on game will go to Focus mode of your game (if not full screen), same can go with clicking any keyboard button (unless you WebGLInput.captureAllKeyboardInput = false;). As long your game have cursor locked it will keep happening. Anyways it is most likely because of character controller which do good job at locking cursor. And the moment webgl got html focus it starts working.

arctic rose
#

You don't "click" a keyboard, and a 3rd person controller obviously does nothing to input fields

#

and the behavior is the same on all websites whether they use Unity or not so it obviously has nothing to do with Unity

elfin portal
#

me confused

mossy hamlet
#

Many users have this error

astral wave
astral wave
#

also to be sure you can build developer version with full stack , open console and see what script causes it

mossy hamlet
astral wave
mossy hamlet
astral wave
mossy hamlet
astral wave
#

Have in mind that profiler in Editor and profiler in Standalone will give VERY different results. But I asume you want to run your game on Phones. So if you want to run it at IphoneXr (4gb memory), you need to consume less than 500 MB preferebly. If it goes higher there is high possibility you will see that error. At least that what I learned from my experience

mossy hamlet
astral wave
mossy hamlet
#

I tried many things in the PlayerSettings like changing the compression, the quality, Net 2.0 instead of 2.1, still the same

astral wave
#

That is my first guess. As you get that error either when you run out of memory. Or when one of your arrays tries to access data from incorrect Key. At least from my experience.

#

Thing is you really need to get access to a way to reproduce that error your self. In controller enviroment. also you could just build developer build with full stact trace, and let people join for a while,and ask someone with error to open browser console and send you error code. as then if it is script error, it will give you exact line of error.

#

So you have two steps now:

  1. Login with same acount, or same data as person who have the problem (as it can be data problem)
  2. Find a way to cause that error your self. Limit your browser memory or something just to trigger it,
  3. Get device close to people who had problems. And collect that data.
#

as if your pc users all had chrome books, no wonder it had that error. but if one of them had Gaming pc...... you can then start investigating your code with arrays and stuff.

mossy hamlet
#

Thank you for your help! I will send that to my dev and we will check everything

jade valve
#

I've made a UI scroll wheel. Works great in editor. On webGL build, it works very poorly. But, if I open the console window. It works perfectly. Any ideas why?

astral wave
#

autoconnect profiler does not seems to work with Https. any suggestions? or shoudl I report is as a bug.

pseudo sundial
jolly flare
#

Hello guys. How do I get webgl to work on Google Chrome on mobile? I was getting it on pc but I did the allow "unsafe" code in the setting and it works pc. Doesn't work on mobile.

jolly flare
#

ok i got it in the debug window it is giving me an 'out of memory" error.

#

ok nevermind i fixed it, apparently i had too much memory alocated

mossy hamlet
jolly flare
#

@mossy hamlet initially I had ythe allocated memory set to 1024. I reduced it back down to 32mb, and it fixed it. Apparently my phone only has 2gb, and it was causing it yto max out memory during loading.

mossy hamlet
jolly flare
#

It's in the project setting under publish if I remember off the top of my head.

#

Project settings>player>publish settings.

mossy hamlet
#

In Publish Settings, I see the compression, Enable Exceptions etc.. but nothing for the memory

astral wave
mossy hamlet
#

Any other settings to check for the Allocated Memory in 2021?

astral wave
#

As far as I know - No. You can work around using addressables and managing what you load to memory manually, so it wouldnt use too much.

astral wave
# mossy hamlet What is Addressables..?

Addressables is Unity feature, whichs lets you handle what is loaded to memory. As by default, when you start your scene, EVERYTHING will be loaded. If you have multiple scenes, multiple scenes will be loaded. Addressables lets you load to memory only what you need. Then when you dont need, you can unload it and free memory. It will still stay in Storage (broweser cache) but not in memory. So performance wise it is very huge.

BUT... weblgl and adressables have some problems when it comes to shaders, as it tends to add load all shaders possible. Which can bloat mamory usage (it depends very much on project. Mine shaders usage increased to 200mb RAM.) But you can manage that by writing your own shader stripping code and solve that problem. (with shader strippign got back to 20 mb memory for all shaders).

#

anyways.... profiling profiling profiling.

mossy hamlet
astral wave
#

IphoneXr brokes at about 500-600mb 100%

mossy hamlet
#

I will try to build a version with dev mode. There is only 1 scene for now in our project

mossy hamlet
#

@astral wave Does this means that the project take 3.22GB in memory to run?

orchid bridge
#

l got this when l try to download unity webgl l got the error and he got stuck at the end l try everytime but its not working and l use bolt

deep topaz
#

i'm having issues publishing a project with visual scripting and webGL, are there known compatibility issues there?

#

None of my inputs seem to work

cloud ermine
#

how to treat webgl build if it's end up with failed ?

astral wave
#

but yeas that shows how much your application uses memory. In this case your application and editor I think.

#

if you will go to tap memory breakdown, you will see how much textures, shaders and scripts are using,. that is good start with optimising project.

astral wave
# cloud ermine how to treat webgl build if it's end up with failed ?

Well I see undefined symbol at at AddNumbers. It is worth checking there. Have in mind that WebGL build is more sensitive, so it checks all your JSlib files (aka plugins) to find any errors. and you have some. Have in mind, dont use ANY non english simbols inn your plugins code, even in comments.

astral wave
# orchid bridge

Step 1) Run hub as administrator
Step 2) Install unity version without WebGL feature. After it is installed, add webGl feature\

mossy hamlet
astral wave
#

In build options turn on Developer mode and turn on autoconnection profiler:

Press build and run. Then game will open in your browser. Open Memory profiler again and you will notice that instead of editor it will be connected to your game on webgl. Make snap shot again and you will have your build game data only.

mossy hamlet
quiet lagoon
#

Can anyone explain why the quality of the game turns to shit when loading a webgl game on mobile or even responsive design mode in browser? If I just resize the browser manually to be the exact same resolution as a phone, then the quality is great. But the second it is a "mobile device", the quality goes down so much it's horrible. Even the "Made with Unity" splashscreen is terrible quality

#

Never mind, I figured it out. If anyone else needs the solution, change the "config.devicePixelRatio" in your index.html file to a larger number than 1. I changed it from 1 to 2, and now everything looks much better

jolly flare
#

Hello, so on my webgl build how do i make the screen rotate on mobile?

cloud ermine
astral wave
astral wave
orchid bridge
#

[webgl error > An abnormal situation has occurred: the PlayerLoop internal function has been called recursively]

So, I've been having an issue with my game. I'm using my own auth and when my game was on mono/windows build, everything worked 100% fine. However, when I switched to webgl I noticed that when I got to my login scene, it wouldn't auto log me in like it should, and when I entered my username/password and clicked "sign in" it wouldn't work and gave me this error: An abnormal situation has occurred: the PlayerLoop internal function has been called recursively.. Note, that error occurs when I run on local or from my website, all the features work if I run it from Unity Editor...

I also noticed that when I was building a windows build, if I switched to il2cpp from mono, the same issue would occur, obviously I didn't see An abnormal situation has occurred: the PlayerLoop internal function has been called recursively., since it was a windows build and not webgl, but still couldn't login.

Basically to sum it up, is it really il2cpp effecting my game login? if so, how do I go about fixing it? Thank you.

astral wave
# orchid bridge **[webgl error > An abnormal situation has occurred: the PlayerLoop internal fun...

If I remember correctly, webgl is always il2cpp type of build. And to be honest that is better. WebGL and il2cpp is way more sensitive when you have incorrect code left somewhere. Windows be like: well you dont use this line of code, so I dont really care. il2cpp: FIX THIS SHIT!!!!!!

Just build developer mode, with full stack trace and check what exactly causes this error. It can be jslib, it can be plugin. It can be as you doing something not over HTTPS (for webgl that is kinda a must for most things). Maybe you trying to access something that is not on same domain as webgl (also no go in webgl).

#

Or you can build on windows il2cpp and check build report to see what is the problem. It is expecially common when you have any javascript libraries. as Editor will not see anymistakes there until webgl build or il2cpp

orchid bridge
#

I tried to build in regular il2cpp before and it wasn't giving errors in the console... just wasn't working. But on webgl it gives error(s).

astral wave
orchid bridge
#

The site/game is public if you want to take a look at the errors it is giving? or I can just send a pic?

astral wave
#

if you turn on webgl develop mode and turn off crash on error, it will work as in windows where you got error on ilc2cpp

astral wave
orchid bridge
astral wave
#

What login you are using? WEBrequest? php one? does login goes to same domain?

orchid bridge
#

Currently it's full without stacktrace, and release.

Also, the auth is built in php but I'm using c# api/class.

astral wave
#

Debug.Log Debug.Log and once more Debug.Log :DDDDDDDDDDDD

orchid bridge
#

I'm uploading updated version of game so I can show you all errors.

astral wave
#

Great, lets see if that will give us more data to help u

orchid bridge
#

That's just when the game loads.

#

Then I enter username/pass and press "sign in" and get this:

astral wave
#

are you trying to use SocketIO?

#

aka you trying to connect dirrectly somewhere?\

#

aka System.Net.Sockets

orchid bridge
#

I need it so that the auth can initialize.

astral wave
#

What these logs dont give a lot of info. at least for me. Did you implement any fucntion called icall?
If you impelement something twice it can cauz problems.

Other reason is webgl limitations... and there are alot of them...

orchid bridge
#

Nope, everything is added once. No duplicates that I'm aware of.

astral wave
orchid bridge
astral wave
orchid bridge
#

So I have a class called api... that is the c# class for all the auth functions.
Then I have a class called func... that is the class that calls the auth functions.
On Start,
I have init(); the process for init looks like this:

#

Everything is built in and the requests that are made are to the auths website.

#

So, I'm using an sdk.

astral wave
#

is this SDK is C#? or Javascript?

#

if it is C# and you try requesting something from different site/ domain. You wont get anywhere

#

Unless the creators of that SDK did somekind of magic, you cannot access anything from web gl that is not in your domain.

orchid bridge
#

The auth was created in php... there are multiple different sdks for the auth (C#, c++, php, py, etc)... I'm using the c# once since it's unity...

Using the same auth, it literally only works with windows build... or webgl build in the unity editor... webgl does not work locally or from my site.

I have all the files that the build provided me so it should be working just like everything else.

astral wave
#

webgl in editor is not webgl. Webgl in editor will be able to access everything without webgl limitations.

orchid bridge
#

I'm just telling you what works and what doesn't.

#

Webgl shouldn't be this difficult to work with. Makes 0 sense.

astral wave
#

AS working on webgl for 2 years I can confidently say.... IT IS WAY MORE DIFFICULT THAT IS SHOULD BE AND NO ONE SHOULD USE IT IN GENERAL.

#

Only choice you have is comment half of your code and then build again and again until you will find where it stops working. But my guess is that you request something not from your domain. We hade tons of problems with authentication, and ended up using API which takes data from authentication server, and passes that data from our domain API.

#

and when you request something u cant, you get error, and that error crashes your things. Normally if that would be just webrequest you would see that in error logs. but something goes wrong in authentication for u. Sorry I cant really help more, that saying limitations of webgl and how to search for more data on error.

orchid bridge
#

Well, I'll try to just disable all the auth functions then and see if the errors still persist or not.

#

Just odd it would work on other builds but not webgl... you'd think there would still be some sort of error or warning but nope... nothing.

astral wave
#

That is best approach, keep disabling features you can until you get it working.

astral wave
orchid bridge
#

Wait... so you're saying it could be the auth not connecting/making request to domain properly so that's why it's not working... so see, I would think that's the case as well but I just remembered that even before I switched to webgl, I went from mono to il2cpp (windows) and had the same exact issue with the login scene... it wouldn't login and wouldn't auto login either.

#

Has to be something with il2cpp because it if was just webgl then I wouldn't have had the same thing happen on windows il2cpp build.

astral wave
orchid bridge
#

Now, I just tried to remove the init function for my auth so it wouldn't make a request and instantly got spammed with the same error ๐Ÿคฆโ€โ™‚๏ธ ... so that's fun. Just keeps getting more and more odd.

astral wave
#

So core difference of il2cpp that is way more strict than mono. Could you try building windows il2cpp then check build report in

#

this will give you more data on error, maybe there will be a clue.

orchid bridge
#

Yeah, building now.

astral wave
#

while building please check if you have any jslib files in your plugins folder. Aslo... you project directory doesnt have any non english symbols riiiight?

orchid bridge
astral wave
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

orchid bridge
#

So I just built/ran il2cpp windows and it crashed when I pressed login..

astral wave
#

but the build were successfull O.o

#

WebGL build Problems

rustic oriole
#

Is there a faster way to see updates for web platform than build & run?

orchid bridge
rustic oriole
jolly yoke
#

Hey guys, I'm having an issue packaging a 2D WebGL game I made - when previewing on unity play, it shows a gray screen and no audio.
Looking at the forums I re-assigned my canvases to scale by camera, adjusted player compression to brotli (the game gets stuck at 90% loading if this is not checked), selected the tag as MainCamera, and added all scenes to addcurrent but it still just says made with unity and then shows a gray screen. Any ideas or need additional info?

Really appreciate the time and help thank you

astral wave
jolly yoke
#

does something else need on?

astral wave
# jolly yoke ^

So In play mode everything works. Just doesnt on webgl build right? What rendering pipeline it is?

#

Not URP for sure.

jolly yoke
#

Honestly I'm not sure which one i selected when I started the project. is there a way to check and/or switch it?

astral wave
#

To change it you can do it from package manager by downloading Universal RP. I guess you are on default pipeline, as camera have almost no options ๐Ÿ˜„ I know that HDRP (High Definition RP) pipeline will not work on webgl, but IDK how it looks like just from camera settings. you can cahck in your package manager if you ahve it installed or not

jolly yoke
#

ill take a look rn tysm for ur help

#

was not installed so must have been default or HDR im not sure. Was just a small side project so didn't plan ahead foxotiHAA

#

After doing some live learning sessions i'm starting to see URP is and should be the default in most scenarios in my case at least lol

astral wave
#

Have you tried to build windows version of it just to check if it works there?

#

Yes, URP is a way to go currently.

jolly yoke
#

I didn't - running pretty lightweight on the engine atm I would need to install the dependencies for windows. Have only been doing webgl so far

#

ill try this first. After I hit install do i need to go into settings somewhere?

astral wave
#

you will need to convert your materials to URP.location of that differs on your unity version:

#

this is 2022

#

are you using default Unity webgl template?

#

Also have you chacked browser Logs? is there any errors?

#

F12 on chrome

jolly yoke
#

which tab shows this area? cant find it

#

I havent tried running a webserver to test games locally either so im not sure if it would report logs without one

astral wave
#

You dont need webServer if you press build and run. it will create your own temporary webserver.

#

So then you got gray screen even on your play mode?

jolly yoke
#

no in play mode it works fine

#

just when trying to play in play.unity.com - uploading the project to my portfolio on there

astral wave
#

Try changing

#

this will make sureif it camera options or what. you can also just ppress build and play so you wont need to upload anywhere

jolly yoke
#

From forum advice i changed that from screen space overlay to the camera in the scene

#

was already at the overlay setting beforehand

#

im not sure if its just not loading the camera at all, theres music playing in the menu but the listener doesn't appear to work either. doesn't detect sound

astral wave
#

it very much sounds like there is no camera at all. But that does not explain why it does not exist only on webgl

#

do you have nay scripts tha controls camera?\

jolly yoke
#

There shouldn't be , camera is static in the scene. Would you mind coming in a call with me? Might be easier to overview the project and go over some things

astral wave
#

I am currently at work. so I cannot. I could do that in 8 hours only :DDD

#

Non urp render pipeline:

#

this setup should work. and from there to check what is the problem

#

another problem could be that for somereason build does not include Shaders for UI and others.

#

how does your build settings on graaphics looks like?

#

something like this?

#

or like this?

jolly yoke
astral wave
#

Seems about right X.x

jolly yoke
#

just tested windows build - works flawlessly of course lol

astral wave
#

just in case what unity version u using?

jolly yoke
#

2021.3.7f1

astral wave
#

So if it works flawlesly I can imagine only three situations:

  1. Continional scripting. SOmething in your project runs before camera and gives errors.
  2. Build settings missuse
  3. Random WebGL bug that makes no sense whats so ever................. That is more common than u could think.
astral wave
jolly yoke
#

The only thing i have run on awake is to assign music and allow it to persist across scenes

#

only player setting that was changed was to use brotli. If I click no optimization or gzip the game gets stuck at 90%

#

Actually come to think of it. I might have some leftover code that was giving warnings that I forgot about. Was learning how to have sound effects persist across scenes and cut it for now (playing a sound on button click and immediately load into scene without sound cutting out)

#

That might be causing the problem

astral wave
#

Try check decompression fall back and run locally isntad of unity play

jolly yoke
#

Ill try running locally but ill show you the error it says about running webserver

astral wave
#

you could try to disabling game objects you think can cause anything and run as barebones as possible

jolly yoke
#

well is it possible for this to happen even if the scene isnt awake yet? the code that has these warning is on the main game , not the menu

astral wave
#

press f12

#

go to console window

#

press ok

#

see more information about error

#

You have null exception somewhere it seems.

jolly yoke
#
    at Build.wasm.br:0x47c7b
    at Build.wasm.br:0xb40df5
    at Build.wasm.br:0xa85f2a
    at Build.wasm.br:0x1ebde2
    at Build.wasm.br:0x7dcb01
    at invoke_iiii (Build.framework.js.br:3:364167)
    at Build.wasm.br:0x67fab
    at Build.wasm.br:0x605739
    at Build.wasm.br:0xc6501
    at Build.wasm.br:0x72177
    at Build.wasm.br:0x2fe11b
    at Build.wasm.br:0x161146
    at Build.wasm.br:0xa435aa
    at Build.wasm.br:0x8afbbb
    at Build.wasm.br:0x8781a7
    at Build.wasm.br:0x44cd17
    at Build.wasm.br:0x44cd8b
    at Build.wasm.br:0x3f4548
    at Build.wasm.br:0x7dcaf3
    at browserIterationFunc (Build.framework.js.br:3:203686)
    at callUserCallback (Build.framework.js.br:3:156884)
    at Object.runIter (Build.framework.js.br:3:158144)
    at Browser_mainLoop_runner (Build.framework.js.br:3:156419)
Build.loader.js:1 warning: 2 FS.syncfs operations in flight at once, probably just doing extra work
astral wave
#

do you have any red errors in console when you press play on editor?

jolly yoke
#
exception thrown: RuntimeError: null function or function signature mismatch,RuntimeError: null function or function signature mismatch
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[561]:0x47c7b
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[56976]:0xb40df5
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[51975]:0xa85f2a
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[11574]:0x1ebde2
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[39663]:0x7dcb01
    at invoke_iiii (http://localhost:59246/Build/Build.framework.js.br:3:364167)
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[2054]:0x67fab
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[28521]:0x605739
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[5036]:0xc6501
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[2482]:0x72177
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[16049]:0x2fe11b
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[8818]:0x161146
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[49343]:0xa435aa
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[44122]:0x8afbbb
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[43438]:0x8781a7
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[22689]:0x44cd17
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[22689]:0x44cd8b
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[20853]:0x3f4548
    at http://localhost:59246/Build/Build.wasm.br:wasm-function[39662]:0x7dcaf3
    at browserIterationFunc (http://localhost:59246/Build/Build.framework.js.br:3:203686)
    at callUserCallback (http://localhost:59246/Build/Build.framework.js.br:3:156884)
    at Object.runIter (http://localhost:59246/Build/Build.framework.js.br:3:158144)
    at Browser_mainLoop_runner (http://localhost:59246/Build/Build.framework.js.br:3:156419)
#
:59246/fullscreen-button.png:1          Failed to load resource: the server responded with a status of 404 (Not Found)
:59246/unity-logo-dark.png:1          Failed to load resource: the server responded with a status of 404 (Not Found)
:59246/progress-bar-empty-dark.png:1          Failed to load resource: the server responded with a status of 404 (Not Found)
:59246/progress-bar-full-dark.png:1          Failed to load resource: the server responded with a status of 404 (Not Found)
``` In acsending order
astral wave
#

try running localy and if u get same errors. Quick suggestion to make things faster:

#

check these options. Run it localy via build and ruin. And you will get way more specific error. maybe even direct place of error.

jolly yoke
#

trying

#

just set up the dev build mode and stacktrace, building now

#

also removed the component that was causing errors but that only ran on gameover actually. Not sure if it would cause issues on init

#

Okay - so dev build appears to work !

#

Game is very small so I might not even care to go back and use the optimized settings if difference is nominal @astral wave

#

Actually wait I just zoomed out - it has one error on screen that says Nullreference , object reference not set to an instance of an object on main menu window, but the game does run

#

Im pretty sure its triggerloss, not sure best way to implement this aside from just having it as a separate component in the main game.
Could I write a conditional here and what would null = if nothing is found?

astral wave
#

Also I strongly suggest dont use any of find functions if not needed. they are quite slow, and it is better not to use them too much,

jolly yoke
#

Well apparently that code functionality was deprecated and i used something more efficient - deleting the entire reference made no affects. I'll look into FindOfType - thank you for helping me learn how to debug in unity! First time ๐Ÿ˜„

#

I'll give the build another go in shipped mode, and with exceptions turned back off

astral wave
#

Glad to hear we somehow found the start point of problem ๐Ÿ™‚ good luck ! dont forget: red in console = BAD ๐Ÿ˜„

jolly yoke
#

its strange that it works locally but now gets stuck at 90% on unity play with exceptions enabled however ๐Ÿค” will see the outcome after reverting default settings / shipped build

#

i'll have to follow up with you in the morning, 1AM here. Seems shipped still wants to refuse to run, not sure if another error will happen going back to another dev build

flint carbon
#

anyway we can use npmjs packages in unity

#

Im trying to use and npm js package with my wegl game is that possible

sweet oriole
orchid bridge
#

Getting these errors:
First error is on load,
Second error is when I press my login button. Any ideas? If you need any further information please let me know and I'll provide it. Thanks.

astral wave
#

I require optimization tip. Project I work on have quite a lot of Downloading to do. All is done with webrequest download handler. Normal stuff. But while downloading the performance is really bad (as there a lot of downloads at the same time), yet CPU load difference in task manager is almost not noticable. I assume that main problem is everything is happening on one thread, so thats why it going super slow, and there is no real workaround on webgl. But it is still weirdd that non of my PC threads show that inpact. Maybe I just naive to expect to see the inpact on thread and my PC thread at the same time.

What are suggestions about that?
I thought about downloading one by one, so it would be less load at the same time, but that will take bit too long. Or download behind "loading screen". But maybe there is a secret souce>? anyone>

fluid lily
#

I'm calling some javascript code that opens a popup, and safari is blocking the popups while chrome/firefox are ok with it, any ideas?

#

I do the call when the user press a button in the game

arctic rose
#

Find some alternative to a popup window (assuming that's what you meant)

#

Adblockers can block it on any browser and Chrome + Firefox probably have some heuristics that can block it anyway. Mobile browsers don't even have the concept of popup windows.

#

Opening a link to a new tab should be safe

silk brook
#

why my ctrl v (paste) doesn't work on an input field on my webgl ?
while it's actually works fine on the editor ?

mossy hamlet
#

Hey guys ! is it possible to send a value from a HTML Input Field into Unity? because it's really a p... in the a... to manage the Input Field in WebGL. Sometimes it works and sometimes not.. -_-

mossy hamlet
#

I will start to think to use this method: https://www.youtube.com/watch?v=3g0N__K7Wlo

โœ… Get the Project files and Utilities at https://unitycodemonkey.com/video.php?v=3g0N__K7Wlo
Let's check out how to send Data from Javascript/PHP into a Unity WebGL build!

Unity Manual, Interacting with Browser Scripting
https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html

How to create a Graph in Unity
https://www.youtub...

โ–ถ Play video
bronze laurel
#

Is anyone well-versed in Javascript?

#

I'm trying to figure out how to evaluate a button click in JS for an in-game browser event

orchid bridge
mossy hamlet
lime mica
#

is webgl production ready? how much % of desktop performance can i expect?

sweet oriole
# lime mica is webgl production ready? how much % of desktop performance can i expect?

CPU: 1.5x loss in WebAssembly + single thread + whatever the browser and addons decide to do
GPU: 2x loss. 10 year old graphics API.
A lot of the more clever optimization tricks may not be available due to the portable nature of the platform and old APIs, but development is ongoing both on the Unity side and web standards side (WebAssembly CPU intrinsics, WebAssembly threading, WebGPU...).

lime mica
#

10 year old graphics API is a killer

sweet oriole
#

You can still make great games despite of these things.

lime mica
#

can it handle a game like diablo 3? low poly stylized

#

or only ultra low poly baked lightning?

#

is realtime lightning not good?

sweet oriole
astral wave
# lime mica can it handle a game like diablo 3? low poly stylized

It all depends on your project. You will need to do things differently if you want to do it on webgl. Maybe cut into smaller scenes and etc. You can forget open world as it is. But to be honest I strongly believe something like diablo 3 is possible on WebGL, but you will need to use quite a lot of cheats. One more thing that was not mentioned, RAM usage is also not the best, some browsers can have limits how much use and etc, you you will need more loading to and out memory things.

It can handle real time lighting, but I strongly suggest against that. Baking lights is almost a must, but you need to do it cleverly as of memory limitations.

URP
Addressables
MemoryProfiler
Profiler
Unity 2022

This things is what you are looking at and is quite a must.

astral wave
mossy hamlet
astral wave
mossy hamlet
astral wave
cloud ermine
#

guys how to configure Unity 2020 Web GL memory allocation ?

#

my current build is totally out of memory allocation

#

is this working ?

astral wave
#

update to Unity 2022 for extra goodies that could maybe replace your needs

cloud ermine
astral wave
#

yes it is only on 2022. WebGL got a bit love on 2022. and most of features will not go to lower versions

cloud ermine
cloud ermine
#

do I need to set max the initial memory size ?

cloud ermine
unborn marsh
#

Hi I'm getting
abort("both async and sync fetching of the wasm failed") at Error at jsStackTrace
Does anyone know how to fix this? Thanks!

#

It worked earlier and now just stopped

unborn marsh
#

When I choose GZip compressing it doesn't show any errors but also doesn't load (Just Unity image and empty loading bar)

strange tangle
#

Has anyone had any trouble building with 2022.2.0b6? I keep getting the build process frozen at linking wasm files ๐Ÿ˜ญ

astral wave
# cloud ermine what specific version of 2022 ?

2012.1.12 or later. otherwise you wont be able to connect profiler to your WebGL project. Well if I understand correctly, some meory is assigned at the start, and if it snot enought it will expand until maximum. when reach maximum you will get memory out of bound message. But for WebGL youshouldnt aim more than 512 MB anyways so

astral wave
unborn marsh
astral wave
# unborn marsh Locally

build and run? or local web server? As if local webserver have in mind that index html differs depending on which mode u using

unborn marsh
astral wave
#

have you tried this?

astral wave
unborn marsh
unborn marsh
astral wave
#

hmmmm, I have not problems with brotli tho on that end... hmmm

unborn marsh
#

Yep it's strange... It started happening even with a build back from 14 of July... Now I have the same problems with this one

#

But a new build from a new project works

astral wave
#

what is your unity version?

#

well if new project works. maybe your library got corrupted

#

you can try deleting library folder in your project and let it rebuild it self on next start of project

#

if there is really no other key elements you added, like updates, new scripts or plugins

unborn marsh
unborn marsh
astral wave
#

maybe setup of your webserver got access problems or something

unborn marsh
astral wave
#

Running index.html have a lot of limitations.

  1. browser security. you need to disable security of loading webgl applications. each browser have different setup
#
  1. I dont think that it will work unless you put it in your local webserver. What ever app you using IIS or etc. But then webserver needs to be configurated to run compressed data
#
  1. make clean build. if you not making clean build there is a chance you still using old indexhtml, which have wrong files setup to load. Or before building delete everyfile in that folder
cloud ermine
#

can't move on from 2020 at the moment since one of my plugin was made there

astral wave
cloud ermine
#

I've been seeking it hours ago on registry but can't find it, let me double check

cloud ermine
#

on certain scene it keep saying memory out of allocation

cloud ermine
#

I mean I already have everything here, but yeah on 2020,
I really no idea how to put a maximum allocating memory on webgl

jade valve
#

i uploaded a zipped webgl build to my unity dashboard. when i try to play it from 'build history' i get 'unauthorized'. any ideas why?

cloud ermine
faint grove
#

Has anyone seen this OpenGL ES exception before when pressing the browser back button to exit a Unity WebGL page?

exception thrown: TypeError: Cannot read properties of null (reading 'deleteFramebuffer')

#

Also, are the loader.js and framework.js files that Unity creates for WebGL builds available anywhere in a more human readable format (i.e. with new lines, spacing, etc)? I'm assuming that it's inlined to save space but it would be amazing to see a prettified version.

orchid bridge
#

My webgl game isn't loading when I use my auth. I had a thread but apparently my issue wasn't important enough to staff ๐Ÿคฆโ€โ™‚๏ธ .

Auth works 100% with windows (mono and il2cpp) but when it comes to webgl it isn't initializing my auth.

cloud ermine
#

what Unity version ?

orchid bridge
cloud ermine
sweet oriole
#

WebAssembly or at least Unity's C# implementation on it appears to be very network restricted, so if you aren't using Unity provided network methods, you should probably doing it through JS.

plush oxide
#

Please is there any leaderboard plugin that works well for webgl builds?

orchid bridge
orchid bridge
cloud ermine
plush oxide
cloud ermine
#

this is webgl build room ...
try to drop the question on general

patent beacon
#

been half an hour, still not done

#

this is taking so insanely long

#

wait just done

#

lmao finished right now

#

btw do I have to set the itch.io project to 'html' or 'unity3d < 5.1'

#

alr I set it to html and it works

#

but it doesn't set the screen size for me

cobalt finch
#

anyone familiar with firebase webgl? Im getting a firebase.firestore is not a function error

cloud ermine
cobalt finch
# cloud ermine what service you use ?

oops, i resolved the issue. Apparently I was using the "import" method of importing the module, but the accepted one is to use the <script> tag in the html file

astral wave
#

Depending on pipeline. Everything in URP works. Nothing too much to be aware off of what I can remember. If you using addressables prepare to create your own shader stripping or Unity will add all shaders variants in your project and destroy the memory usage.

Still webgl is very performance heavy, so the simplier shaders are the better it is.

astral wave
#

Oh also depends on your Unity version there were some bugs regarding shadows on shaders, and they might be invisible if recieve shadows is used. but it was fixed so if you are using newest version, there should be any problems. Also I suggest using 2022.1.12+ version, as 2022 have more things on webgl than previosu versions and quite a lot of things wont be backproted to older versions. have fun in Hell that is called WebGL

flint carbon
#

unity webgl build gets white screen while playing with this message - WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost

#

is anyone familiar with what this is

astral wave
#

from what I see on forums, it is when your browser loses control on your GPU. Try reducing resolution and improving performance and test if that still happens

#

Also check if you not running out of RAM while loading somekind of model

#

some people reported that changing renderer size helps

#

So in short, most likely Memory leak of some kind until you crash your webgl

cobalt finch
#

For firestore in webgl, how do i pass in merge options for SetDocument?

#

Basically I want to use IncrementFieldValue, but I want it to automatically initialise the field value if it does not already exist int the database

patent beacon
#

no particles or effects

#

3 animations

#

so that was sad

#

as least it worked

flint carbon
#

i think that might be a reason right for the game to crash

flint carbon
#

anyway i can reduce the load on cpu when donwloading those images

flint carbon
flint carbon
flint carbon
#

also anyone know how to stop this from happening

#

SocketWebTcp.Disconnect()

#

it happens on its own

novel cipher
#

is this because unity can handle null pointers but as default webgl builds do not?

astral wave
# flint carbon it happens on its own

By default webgl crashes on ANY errror. You can evade that by enabling debug build. And I suggest to add fulll stact trace and then on crash check logs so you could see exact line of code that makes it

astral wave
# flint carbon im also getting this one - [Violation] 'load' handler took 928ms

Downloading images from web and displaying it uses HUGE amount of ram. For example 1mb image will take about 12mb of ram.so you can imagine how fast it blows up. I havent found the solution to this yet. Most likely need somehow compress on load, but still not sure how to do that.

well TPC conncetion timeout can be increased on your webserver.

'load' handler took 928ms this one ... well you can ignore that. at least I do. it is more about webgl is beeing too big for browser. but it will work anyways

#

oh it is exactly that ๐Ÿ˜„ lolz

novel cipher
#

it seems to be very hard to get the webgl to render correctly

#

i have no idea why it is drawing something weird on bottom of the screen. i mean that reddish / orange thing that should not be there

astral wave
#

Oh i thought that is just HTML ๐Ÿ˜„

#

As red arrow shows at the text, which is set to be bottom right. So I would assume the Actual screen of webgl is The blue line screeen. and under it is index.html template default webgl logo with full screen button. As that button most likely is HTML, at least from templates I have seen. So thats why i tihnk the redish part is also part of html. But that is just my guess

flint carbon
astral wave
#

sweeeet. I hope you will have more luck than me. Expeccially with all limitations on it ๐Ÿ˜„

#

Oh that was two years ago. Now I can't even remember what problems I had with VR. Besides not beeing able to use XR unity plugins normaly, and eveyrthing needed to be coded from scratch. Performance issues when it comes to any more complicated scenes. Problems with making it Full screen without plroblems on different browsers. HTTPS permissions issues.

#

but that was two years ago, so maybe some things got better.

#

And the worst... 60 fps limitation on browsers......

flint carbon
astral wave
flint carbon
#

photon

astral wave
flint carbon
#

ohh any idea where i can find that to change the settings

#

photonmanager.keepaliveinbackgroud will this work

astral wave
#

well that is kinda a must. as if window is not active you wil lget disconnected

#

but from what i learned with mirror, that wont really hellp on webgl if you will have other window opened

flint carbon
#

oohhh

#

i cannot find the code where i can increase the timeout

#

increasing the timeout will that be sufficient ..??

astral wave
#

Tbh no idea. YOu shouldnt get timeout in the first place as long there is no errors. Well sometimes there is problem with web server. As Photon time out is longer than WebServer timeout. So webserver time outes and closes websocket early.

#

that option depends on your webserver provider

flint carbon
warm quartz
#

wanna ask how to deploy your dedicated server and webgl to host and client with mirror any tips?

#

I just realised here has a webgl channel

#

and I know I need ssh what requirements do I still need to make it host and client?

warm quartz
astral wave
warm quartz
#

does it possible with dedicated?

#

abit like create lobby than called the host

#

like server room

#

something like this in a dedicated server

astral wave
#

https://www.mamp.info/en/windows/
https://www.apachefriends.org/
windows IIS.

This can help you make local host.

IMPORTANT: WEBGL CANNOT HOST with mirror. you can only connect as client. You will need linux or windows host.

To test as client you can build serverr run it. And then just press Build And RUN in unity on webgl platform it will automaticly will host your webgl and u can test it.

warm quartz
#

I already have Linux and Windows host

astral wave
#

Yes, you can build room logic with one, or multiple server with mirror. it is not out of box but you can.

warm quartz
#

but the things was I do no how does window or Linux host work

#

when to create when to close

#

so it borther me weather need to install software behind

astral wave
#

if you will host on your computer, you dont need any applications.

  1. YOu need server buiild.
  2. then open ports used for your server (otherwise noone can connect outside the connection). Locally everything will work.
warm quartz
#

cause I am thinking about can I like https something / 1 2 3

#

is just like creating a room with parameters

#

cause seen my client cannot be https or http instead of my dedicated can be https from ssh

#

and my client need to local to my decidated wasn't it?

astral wave
#

You can connect with webgl only on same domain. Mirror by default dont let you add parameters, only main html/ipaddress. You will most likely need JS which will read you Path parameter, pass it to WebGL, which will change PORT number to correct Server or Room. Depending how many server and rooms you will have.

#

then you will connect to server and there all depends on you.

warm quartz
#

so as default it all depends how many server I create in my Linux and win is it?

#

is like that so ah F this gonna be hard

#

@astral wave can I add you and forward me the details?

warm quartz
#

oh we already friend

#

๐Ÿ˜‚

astral wave
#

yes, webgl is pain in the ass and I suggest everyone not to use it if they can ๐Ÿ˜„

warm quartz
#

I need to use it to develop mobile stuffs

#

๐Ÿ˜…

astral wave
#

well depends on your game scale. you can have one server with 100 rooms of 3 or 2 players. or you can have 100 servers with 100 rooms of 200 players.

astral wave
warm quartz
#

that's the things

#

๐Ÿ˜…

novel cipher
novel cipher
#

i was thinking about switching back to using older versions of unity, as i think they are faster and lighter to use. but do they have even more issues with webgl builds? or has it been getting better with new unity versions?

novel cipher
#

thanks, i was kind of afraid that this is the case

#

though i think my shadows are working

warm quartz
#

Good topic I wish I can done this tasks

faint grove
#

Is it possible to modify the framework.js file that Unity auto-generates for webgl builds? Like pre-build, so I don't have to manually modify it after the build?

faint grove
#

I want to modify the _glDeleteFramebuffers method in framework.js. I need to put together a minimal project for reproduction purposes that I can use to file a bug with Unity, but I haven't gotten to it yet. In the meantime, I need to add an additional null check in that method, as it's throwing an error for us when a user exits our page.

faint grove
#

I'm probably just going to do this with a PostProcessBuild method, although if Unity changes the contents of framework.js in future versions, that will of course break. Ah well, at least it will work for now.

astral wave
#

Was that a sarcasm?

  1. you still downloading it, so size is still the same, it is just stored in your browser cache. Where cache control is a mess. You can download game and made it run without installation. On phones, just download app from asset store, have icon always ready on you menu, without opening any browsers, best shortcut ever. The URL convenient only if you use the application ONCE. As if you would use it more often, it is actually less convenient. If you make WebApp to be used only once, sure it is way better than downgliding. Thats why I think WebGL is amazing from presentations, more live 3D model preview. But game? ..... Well.... questionable. As almost all games are made for people to play it multiple times, or over multiple sessions. Even monetizing is better when user joins application everyday, so they will have more chances to buy things.
  2. Or your target people are one who plays video games in work, where they cant install anything.
  3. and what you get as exchange for this questionable advantage of using WEbGL? :
    a) no need to setup application store of any sort on mobile.
    b) no way of prove security rather than saying it is secure for client
    c) losing tons of performance, beeing forced of limiting user experience, visual fidelity, increasing time needed for development by at least 3 times
    (build time alone ignoring all bugs that comes from webgl).
  4. you learn how to use profiler and optimize your game pretty well. yet you hate your self everymoment as it still dont run as well as you would like it to run.
#

dont get me wrong, there are situations where webgl can be super. for example events. where people will use your webgl and wont use it again until next event or at all. when target people are dynamic and quite random.

sweet oriole
balmy thicket
#

Hey folks, is it possible to publish to Unity Play privately? I'd like to use it as a convenient server alternative for sharing dev builds with my team remotely.

high patrol
#

yeah Unity has a hosting solution for that I believe with Cloud build

#

$$$

flint carbon
#

I previously had a discussion about Web socket disconnect in this chat. I couldn't find a possible to way the disconnect from happening. I'm using photon. I was thinking to add a reconnect to the web socket with playerTTl. Will that be any possible fix to this problem..??

indigo crest
#

Hey, i have a VPS server with mysql database and some php files to manage the data. The game works fine hosted on the same server, but when I try to upload it to itch.io, i get this error : Access to fetch at URL has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

indigo crest
#

That's very helpful, thanks you so much. Not only you help me with my issue, you explain how it works, couldn't be more grateful. I'll test it out in a few hours and let you know.

indigo crest
#

It worked, thank you very much, hope more people would be like you.

flint carbon
#

im using sendmessage in webgl index file and doesnt seem to work

#

ive put this is code in script tag in last part of the body tags

visual hemlock
#

So, I know next to nothing about Unity so after countless days of searching and testing things myself I've decided to come here. How on earth do I open up a .unityweb file in Unity?? I know it is possible as I've seen an acquaintance do this, but he won't share how he has done it for some petty reason which isn't really relevant. At the moment I'd just like to get into the project.data.unityweb file, which I've already done using AssetStudio. If it is possible, which I don't know if it is, getting into the wasmcode.unityweb, wasmframework.unityweb and alike would be a big help too. Please ping on reply if possible, thanks :)

arctic rose
#

You can't open the file directly in Unity. You'd need to decompile and rip the assets first which is off-topic here.

visual hemlock
#

I think I've figured how to decompile and rip the assets already, but which would be the appropriate channel for talking about that/asking questions about it here? Also to clarify, the person who has supposedly opened the file directly in Unity, is he just bullshitting that or has gone a different route?

somber oxide
#

everytime i click refresh on edit thingy it just says failed

#

why?

arctic rose
visual hemlock
#

Ah, gotcha.

somber oxide
#

im trying to download editor and it just says failed

#

if i refresh it

#

after like 2 seconds

#

it fails again

#

help

cobalt finch
#

How do i solve the issue of hosting my webgl application on a site, and Chrome browser blocks my UnityWebRequests to fetch data from other domains due to CORS?

#

so should the header be applied on my site's php file or examplesite's php file

#

ok wait

#

aw

#

the issue now is i dont have control other domains, and i am trying to fetch data from their site

#

what does this mean

#

any idea where to start? prefably the easiest solution if possible

#

๐Ÿ˜ฎ

#

correct me if i am wrong, but it is because Chrome browser itself have cors as a security

#

because i ran chrome with security disabled and it runs fine

#

yeap

#

so its not wordpress thats blocking it, its chrome

#

because i set the php header in my wordpress file already

#

and the htaccess file

#

and its still not allowing, so yea its chrome

#

which im not sure how to solve

#

alright i shall try to decipher this xD, still an amateur on custom endpoints and stuff

#

just to clarify, this cannot be done via Unity only? Do i need to setup some extra server or something?

tough cypress
#

i cant interact with the UI of my webgl build when its not fullscreen

#

im using version 2020.3.12f1

warm quartz
#

webgl having this issues with s3

ashen lark
#

Hello. I'm making a custom web Template with VueJS, and the unity-webgl package, which allows me to get the specific files. However, I'm also following a build-name scheme. Is there a way to pass the build name as a variable to the template?

orchid bridge
#

Hi There,
would anyone be able to help me out with this issue. im trying to publish my finished product onto my profile but the builds running into errors i just am not familiar with
what does this mean

cloud ermine
#

like kongergate webgl ?

ashen lark
astral wave
#

so when webgl 3.0 is comming? ๐Ÿ˜„

warm quartz
#

EXCEPTION: SocketException Message: No connection could be made because the target machine actively refused it.

#

I checked the article I wonder is it because of firewall or port build

#

cause I am getting an ip address and port from my dedicated server

urban storm
#

hey guys, I am quite new to unity world, and I'm trying to make a webGL Unity hosted by React, but it is not working for me.

#

this is my code

#

this is the situation

#

Nevermind, It was compression issue!

cobalt finch
#

hi, I am aware that window.onunload event does not gurantee that all subsequent callbacks will complete fully. Any way to tackle this? I am using the unityinstance to sendmessage to call a function that logs data (which calls their respective callbacks), and my data logging callbacks does not run when the page refreshes

zenith mason
#

Hi guys. im trying to take a snapshot in memory profiler from webgl build. When I have focus on the application in a browser the console logs that the profiler is connected. But when I hit "Capture snapshot" it logs that the application was paused.... How can I do that?

tardy musk
#

I have a problem with the LoginWithCustomId() function. I'm making a game which i published on web and windows for now, I am using SystemInfo.deviceUniqueIdentifier as a customid login. However, this doesnt work on webgl, since its not supported there, does anyone know a solution to this problem?

arctic rose
#

There are no device ids available on the web. You can generate your own and store it in playerprefs for example.

tardy musk
arctic rose
#

Any way you want, for example Random.Range(100000000, 1000000000)

tardy musk
arctic rose
#

It's technically possible for device ids to be the same as well

#

If you're worried about collisions, make the random id longer

tardy musk
#

Is there a way to check if they are the same?

tardy musk
arctic rose
tardy musk
arctic rose
#

I'd be keen to hear it

#

Well, if you store all generated ids to a database and compare to them when you generate a new one, then maybe

#

but why bother

tardy musk
#

Hmm

#

Ok thx for helping

arctic rose
#

For example, if you generate a 64-bit id and everyone on the planet plays the game on a new device every day, the first collision is expected to happen in a few billion years

high patrol
#

you could do Time.time down to the milisecond + a random number + a random salt + run it through a hash algorithm like sha256

#

if you're paranoid about collisions

sweet oriole
#

You probably want to use existing GUID generation mechanisms over gobbling something together in the hopes of not getting a lot of collisions. On the other hand, if you are trusting the client to do something reliably, you are going to have a bad time. Some lessons from the web dev world, which you can use in Unity browser builds through JS communication: https://medium.com/teads-engineering/generating-uuids-at-scale-on-the-web-2877f529d2a2

wet fog
#

hi, trying to play a music in webgl from url, is this possible?

#

so I was trying to use something like this to get files from url. It works great in editor but in build I get a "ConnectionError" from this debug

wet fog
#

okay :). preferred is mp3 mpeg, but might be wav, thought its not easy to convert from byte[] to audio?

wet fog
#

okay, I only have issues with downloading it

#

tried this and this and nothing realy works

languid sparrow
#

srjagh,erglqerge 'error creating webGL context'

#

~unity 2022

#

it runs on a page generated with build but not when i embed it on a page that uses canvas made by me

wet fog
#

hm, how would you go about downloading an audio from url?

languid sparrow
wet fog
#

it says 'ConnectionError' :/

wet fog
#

okay I found the true cause of this :D, trying to figure out the solution now

wet fog
#

okay found a solution nvm

urban storm
#

Hey guys, one question here:
If I make a WebGL game and publish them via webview on mobile app, does that game run on local devices or I need to provide a server that runs it and pay for that?

patent pollen
#

if you want to put it on a website tho, you will need to pay to host the website and pay for the domain

#

you can host a webgl game on itch.io for free, so if money's an issue and you're ok with hosting on a third party website, i'd highly recommend checking it out

lost oak
#

Hi friends, very new here and been playing with unity a few months now ๐Ÿ™‚

Iโ€™m developing a mission based web game (2d battler) and could get up to 100+ different missions that are selectable from my web page (and not within unity).

Question: Would it be better to create a different webgl build for each mission OR should i create multiple scene within one webgl build and use

#

my webpage to determine scene to load?

tardy musk
#

how do i check in c# if the project is running on webgl?

lost oak
#

Thanks allright! I will start down that path with one build. Iโ€™m guessing I should prefab as much as possible to keep the file size to a minimum and try re-use prefabs in each mission scene?

astral wave
astral wave
#

Also addressables will be perfect for you. Not only you can select stages which to load and unload. One webgl build will save tons of download when you use addressables smartly. For example create package which are used in all your levels, it can be UI, or some other models, like character models and etc. And this way it will download only once, and after that you can load it from cache, so extra stages download and load time will be shorter. Good luck with WebGL, you will need it ๐Ÿ˜„

orchid bridge
#

Why can't I build for WebGL?
"In order to build a player, go to 'Player Settings...' to resolve the incompatibility between the Color Space and the current settings."
What is this?

#

I went to Player Settings, but I can't find any such option

#

I must've missed something?

vapid zenith
#

It's under "other settings"

orchid bridge
#

Ah, OK, ty, I found it

#

It told me to uncheck "Auto Graphics API"; not sure what is that, but regardless, unchecking it got rid of the error message

#

Does WebGL compute physics differently from a PC build?

#

my balls are bouncing off significantly differently in WebGL and in the editor

astral wave
astral wave
haughty stump
#

Hi does anyone know why I can't build WebGL

#

@woven sail

astral wave
haughty stump
astral wave
#

try re-adding it again then. logout and login again anc try again.

astral wave
haughty stump
#

I knew some features do not support HTML5!!!

astral wave
haughty stump
#

Not mentioned the first build issue on WEBGL๐Ÿฅณ

astral wave
#

multithreading is pretty much dead. Mostly you wont able to use most of it. You can still use tasks, but it will work on main thread so same as coroutines and not controls over that

haughty stump
astral wave
#

there are a lot of stuff that are blocked "for security reasons". Like loading content only from your domain and etc.

haughty stump
astral wave
haughty stump
winter stone
#

Hey all ๐Ÿ™‚ Im trying to debug a weird issue: I have a canvas with a raw image in a scene. Attached is a script which is creating a render texture and tex2D at runtime, assigning it to the raw image, and then just assigning random colors using Texture2D.SetPixels, Texture2D.Apply and Graphics.CopyTexture in a fairly normal fashion.

In editor, this is working, however as soon as I build it out, the texture disappears. Not white, black or pink, absolutely not visible. No errors in console, and if I debug, the data is getting created and updated properly, i just cant see it.

Test code im using here: https://gist.github.com/DraconInteractive/9b51eaee76d2577636d7975cce3e35f6

Any advice very welcome, been on this one for a bit

Gist

WebGL Disappearing RawImage. GitHub Gist: instantly share code, notes, and snippets.

astral wave
winter stone
#

apologies, i meant to post back here! I found out that webgl doesnt support copytexture for my version of unity (2020.3), so i changed to passing the texture to a sprite shader, which is working great ๐Ÿ™‚

orchid bridge
#

This is behavior on WebGL: https://play.unity.com/mg/other/webgl-ojn

Unity Play

The place for aspiring game creators to share their latest WebGL creation. Gain inspiration through ongoing showcases and find thousands of FPS, Karting, 2D Platformer and other creations with Unity. No experience needed, just jump in for the chance to be featured!

#

Limiting framerate to different values does not seem to affect the outcome ;/

#

Given that discrepancies only start to become significant after a few bounces I'd guess that WebGL and PC must do floating point computations a little bit differently? So tiny errors accumulate and finally result in wildly different outcomes

astral wave
orchid bridge
#

Also, to my intuition slower calculations should make the game lag, but not change game mechanics?

astral wave
orchid bridge
analog burrow
#

Hi, what is the proper architecture and library for making and deploying WebGL multiplayer game

#

I'm learning PUN now and they said PUN doesnt really support WebGL socket well, they recommended using their server Photon Cloud

#

I also read somewhere and they said I should make a server using node.js, but i dont really know sure how to combine that with PUN and how to override PUN socket

#

anyone have experience in this?

astral wave
orchid bridge
# astral wave You might be correct then. I am not suprised that on WebGL it is bit different t...

This is surprising to me tbh, since some games are very reliant on physics. It wouldn't be fair if the core mechanics of a multiplayer game were different depending on whether a player uses a PC build or plays in a browser!
I am trying to complete Unity Learn tutorials, in this case I am stuck on this one: https://learn.unity.com/tutorial/challenge-the-floor-is-lava
Completing it requires that I publish a WebGL build of this exercise https://learn.unity.com/tutorial/publish-your-project
I am annoyed since I spent many hours polishing this in Unity Editor just to see that WebGL behaves nothing like what I see in the editor!
...sigh...

astral wave
# orchid bridge This is surprising to me tbh, since some games are very reliant on physics. It w...

well.... you will meet this feeling multiple times while working with webgl.

I found something about it. you were correct. it is precision difference on webgl. uff....

1) This is a precision issue that we can't easily fix for WebGL/JS. Sorry.

2) You can workaround this by changing the Fixed Timestep physics settings.

or

 workaround is placing a box collider for the rigidbody to collide with first, because then subsequent collisions with mesh colliders work.
astral wave
# analog burrow Hi, what is the proper architecture and library for making and deploying WebGL m...

https://doc.photonengine.com/en-us/server/v4/operations/websockets-ssl-setup
Nothing more just this. You are forced to use websockets as your transport layers. everything else should be the same as any other Photon stuff

analog burrow
#

thanks for your response, I will take a look at it

orchid bridge
#

But, many thanks for your time and efforts to help me with this ๐Ÿ™‚

#

I'll try the box collider workaround and if this still doesn't work, I think I'm going to give up ;/

#

(although I'm not really sure how to place a box collider for the rigidbody to collide with first, i don't want it to bounce off the box collider, it must bounce off the mesh collider... there should be a way to make it collide with but fall through the box collider, I'll try to experiment a bit)

visual siren
#

On unity 2022.1.16f The directional light seems to not work when scenes are additively loaded. Is there a fix for this ?

ember flower
astral wave
feral nacelle
#

Hey guys just a little question: which is the best way to save data on WebGL application?

feral nacelle
#

I would like to upload my game for the Unity Play Showcase, and I don't know exactly how to manage the saving system ๐Ÿ˜ฉ

tough edge
#

@royal orchid
How to merge post api in unity? with MSSQL and C# code

tardy musk
#

I have a problem, im making a game thats currently on webgl, i want to show touch controls only when the player is playing on mobile, but not when the player is on pc or something else. How can i do this?

ember flower
#

am I the only person getting mouse locking issues in 2022.1.17f1 in WebGL? the mouse is hidden but seems to be moving still and when it reaches one side of the screen it jumps to the other side and moves the camera with it

sweet oriole
orchid bridge
#

Does brotli compression not work with WebGL on itch.io?
I get errors when I have it enabled

sweet oriole
#

Your hosting setup needs to properly handle sending files with the correct HTTP headers https://docs.unity3d.com/Manual/webgl-deploying.html, though this can be a bit more to figure out with thirdparty hosts.
Important projects should figure this stuff out since you lose some % of users for each MB they have to wait for a download.

oblique canopy
#

How do I publish a HDRP game?

keen urchin
astral wave
high patrol
#

that's the mantra of webgl devs. Do anything remotely complicated? You're on your own

astral wave
orchid bridge
#

Webgl ๐Ÿ˜Ž

daring oar
#

Hi guys, any guide to deploy gzip build in Ubuntu nginx? I followed docs in unity but still need some fixes.
https://hastepaste.com/view/jYQO5
Here is my config and bug report.

high patrol
#

I've only hosted with node

full star
#

I published my game with WebGL to try it out(its a work in progress) but when I press play in the Unity Play window the scene loads but my player is not visible. Any idea why that could be? If I press nothing it stops automatically and asks if I want to save it for a thumbnail. However if I press the movement buttons it does not stop until I stop it, so the character controller at least loads. But I can't see the character.

hardy panther
#

I've seen several 3d first person webgl games encounter the same problem when being run on firefox -- the camera, which the rotation is tied directly to the horizontal mouse input axis, constantly drifts to the right by a fixed amount

#

It's not present when I build and run my games -- only when they're being hosted by sites such as itch.io

#

there's no player input during the first 5 or so seconds of this clip

#

just as I suspected

hardy panther
#

on another note, I've discovered that webgl doesn't support urp decals.

novel cipher
#

does it work without that bug with other browsers?

lime cradle
#

Does mobile browser WebGL support Input.deviceOrientation?

halcyon pier
#

I'm hoping some one can help ! My mouse look is totally broken on WebGL! when you move the mouse on the X to look to the sides when the mouse hits the edge of the browser it stops. So basically I cant turn around in the room all the way, its clamped
even in full screen it does this

halcyon pier
#

turns out it messes up because i brought up a canvas , enabled mouse and unlocked cursor and then when i relock it all it messes up

sterile oracle
#

Hi there a have errors to webgl

#

Why does it give an error?

#

๐Ÿค”

#

Hello?

sterile oracle
sweet oriole
craggy verge
#

i'm looking for someone to help with a webgl project (just for previewing materials on a sphere). i gave it a go but i'm having trouble with the production build and the tessellation/displacement shader. if there's someone who is interested in working on it or giving me a hand 1-on-1 i'm willing to pay for your time

halcyon pier
#

in other words unity uses gzip to compress things but it assumes your server has that installed

lofty osprey
#

Anyone knows why URP Directional Light cookie renders on Chrome/Edge, but doesn't render on Firefox? Unity 2021.3.11f1, URP 12.1.7

astral wave
#

I have question as well. So I build scene on webgl with Terrain. Stripped not nessasary shaders. And what I got quite interesting.

  1. PC -> no problems
  2. Android 8 -> no problems
  3. Android 12 -> Terrain shader is invisible. Bushes are visible, but not terrain it self.
    Unity 2022.1.16
    Anyone had seen similar problem or have any tips.
tawny cargo
#

my game works when i press play, but when I try to publish to WebGL the camera isnt centered, some text that should disappear during the game managers start fxn is still there, and no buttons work

first: the camera thing. My game only looks right when I'm in default layout. What do I need to do to set that size as the right size for all games?

and second: any thoughts as to why the webgl build is off?

high patrol
#

check your build resolution. Check your camera resolution in editor. Make sure they're the same

tawny cargo
#

OK I've figured out all issues with the layout in webgl. but when I press the play button, it just becomes disabled. the game still doesnt play out or do anything (as it would if I just pressed the play button in the editor)

if this is noteworthy my game does a webcall when i press the play button. no issues though it works fine

dreamy pagoda
#

anyone got any ideas on this issue?

#

works fine as a desktop build

#

20 mins till game jam submission and slightly panicking

astral wave
#

I have question as well. So I build scene on webgl with Terrain. Stripped not nessasary shaders. And what I got quite interesting.

  1. PC -> no problems
  2. Android 8 -> no problems
  3. Android 12 , iPhone Xr-> Terrain shader is invisible. Bushes are visible, but not terrain it self. Culprit option -> Draw Instanced Without it terrain is beeing rendered.
    Unity 2022.1.16
    Anyone had seen similar problem or have any tips.
tawny cargo
#

after looking a little into webGL debugging here https://docs.unity3d.com/Manual/webgl-debugging.html it doesn't seem to be too straightforward with debugging errors. and the error I'm getting, Object reference not set to instance of an object, isn't in their list of 'usual problems'

i'm nearly certain the error i'm getting is something similar to this https://dev.to/alexandlazaris/why-isnt-my-unity-web-request-running-in-webgl-build-1lfm but I want to figure out how to force the webgl build to give me alittle more information on the error message? or a good way to use Debug.Log (which does work with webGL) to diagnose this issue?

DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

I decided to pick up Unity3D again to get back into the Unity dev scene and to put my (chaotic)...

indigo crest
#

Is it possible to run webgl pages on android/ios? The game would be very small, nothing hard for the phones to handle. Just 2d

sweet oriole
#

Increased support for mobile has been a recent development, so I would be careful with it. Do some tests and also try to evaluate other more web focused engines/frameworks.

astral wave
indigo crest
#

Thanks

indigo crest
#

haha, thank you ๐Ÿ˜„ makes it a lot easier

fossil bramble
#

has anyone experienced a slow software cursor in webgl?

#

Seems to lag behind 3 or 4 frames. Game's running at 60 FPS

charred briar
#

We are still 2020.3.38 LTS across the board, it got the last somewhat clean QA from our team. But that specific build has some WebGL bugs to be aware of.

sly wave
#

Hello everybody. I have an audiosource in game with an audio clip attached and an audiosource used as the output of a videoplayer. Both are set with spatial blend = 1. From editor they work correctly, while from build webgl spatial audio works only for the first audiosource. Anyone know why?

#

Is it possible to somehow use spatial audio in webgl? if no, why in the first case it works?

blazing pendant
#

Is webgl available for mobile phones?
When I searched online I couldn't find a definite answer

neon hawk
#

Hi everyone, I noticed that in the latest Unity 2022 release notes support for the Mobile Touchscreen Keyboard has been added for WebGL "WebGL: Added mobile keyboard support for WebGL to enter text in UI input fields." However, I am still unable to get this feature to work with a build. What am I missing? Do I need to be using the New Input System? Any help is much appreciated.

sweet oriole
charred briar
blazing pendant
#

I haven't started my project yet.
I'm currently doing research into unity webgl, three.js webgl, and babylon webgl to see which is best for mobile

#

But thank you both for helping me ๐Ÿ™‚

halcyon pier
#

for the life of me i cant still make a build that works on unity 2021, its just a black screen (i have no black ui ) nothing loads after unity logo and no errors

#

2019 works fine

#

any ideas?

#

2022 doesnt work too

#

has to be someone here who has this issue besides me

#

why 2019 works , 2021 > doesnt who knows

charred briar
#

Babylon - great for business applications
A-frame - better wrapper for three.js, good for games
Three.js - good for low level 3d
PlayCanvas - good for quick games with low use
Phaser - great for 2d web use
Unity - works if you don't mind the bloat and overhead

sweet oriole
charred briar
# sweet oriole What does "low use" mean here?

PlayCanvas uses their third party servers, so if you are working on big games or things you'll own that matter - you likely won't want to use it long term. But that's just my personal opinion on it.

#

I thought they had pay-per-use licensing but it looks like they don't ๐Ÿ™‚ which is handy.

sweet oriole
#

Oh yea the editor setup is a bit interesting. Technically the engine itself is free

tawny cargo
#

Is there a good guide for how to publish my Unity Game on my website? I have the WebGL file built

charred briar
#

I think the Unity WebGL page is the best place for the getting started info. I use FTP with a custom template for the index.html

silk brook
#

how on earth we adjust the game sizing ?
with memory performance ?

sweet oriole
astral wave
#

2022.1.19 now is the best version ever!
-WebGL: Fixed a bug where losing focus on the player would cause buttons to become stuck. (UUM-3230)

Webgl is saved

cloud ermine
silk brook
#

guys is this configs will make better performance
due to lack memory performance ?

cloud ermine
#

guuuys is this asset compatible with webgl ?
do I need webgl input add on support ?

astral wave
# cloud ermine https://assetstore.unity.com/publishers/48890

If you use english leters only, or latin. No extra works is needed. Just go with new input system and no extra input is needed. Tho from what I see from this asset, you can use it freely in webgl.. Would I recomend it? no. Be a real man and use UI toolkit ๐Ÿ˜„

#

and from their implemenetation of minimap I would not go with it at all. The tutorial video shows extremly non perfpormant aproach, which will hurt you in webgl.

#

Grab the Project files and Utilities at https://unitycodemonkey.com/video.php?v=kWhOMJMihC0
Let's create a very simple Minimap that displays the Player, Enemies and Buildings.

If you have any questions post them in the comments and I'll do my best to answer them.

See you next time!

Grab the game bundle at https://unitycodemonkey.com/gameBund...

โ–ถ Play video
#

this would take you literally 15 mins to implement with way better performance and information.

#

In short, it will work. Would you use it? I dont think.

cloud ermine
astral wave
cloud ermine
#

sorry I mean this one

astral wave
#

I didnt find any info what method they are using for sending emails. But from the way you writing your google account and password into editor....... If it is small project and you want use throw away account, go for it. If you are planning on making using on bigger project, I would strongly suggest investigating code very thoughtfully. As from video I cannot say if it is safe or not.

#

Depending on infromation you want to submit, it can be very dangerous

#

Most likely it is just webrequest post message code or something like that, which you can write your self in multiple ways. For prototyping it can be used without worries tho. I dont want to talk abad about the asset, as is seems well made, presentation is good, quality is also good, price not big. I Just expressing worries about security.

cloud ermine
#

find the tutorial on the youtube yet @astral wave

#

I need an inputfield, and a radiobutton

#

that stored somewhere, email is ok at the moment
used to be using firebase addon, but I'm curious with the add on above

astral wave
#

combine those two tutorials and you can do what ever.

#

anyways, webgl will not have any limitations on plugins you suggested. it will save you time. But will not teach you a lot. it depends on you which is more important to you, skills or time.

#

Time is very important and if you have money, just buy assets, you will be happier.\

cloud ermine
astral wave
#

client dont see it. But question is how you send it. For example if anyone will open google chrome debug tools and check network section what data they will see ๐Ÿ˜„

#

is password hashed? what servives it uses?

#

sending stuff from client needs to be always very carefull. If you send it from client to server and then to your mail. yea sure, no biggies, bet sending dirrectly and addind password in the message ? If code is not written carefully, it will be huge problem.

#

But once again, I did not see the code it self. I dont know how they implemented, there are ways to solve the problem! they might used it, I dont want to say anything bad about their product. Just saying you need to investigate it carefully.

cloud ermine
orchid bridge
#

Hello everybody

astral wave
orchid bridge
#

Please let me know the difference firebox and chrome using webgl

astral wave
# orchid bridge Please let me know the difference firebox and chrome using webgl

https://docs.unity3d.com/540/Documentation/Manual/webgl-browsercompatibility.html
https://docs.unity3d.com/2019.4/Documentation/Manual/webgl-browsercompatibility.html

In general it is almost the same you font feel any different. Firefox might load some things faster, chrome different things faster. It both uses webgl 2.0 so most thing is the same. Safarri have more differences.

orchid bridge
#

Thanks

astral wave
#

Hey...... quick question, can webgl build run on more than 60 fps on Chrome and other browsers?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????/???????? I was pretty sure 60 fps was the max.

#

Even if monitor is 144hz, it shouldnt be able to run on 144 right?

orchid bridge
#

right

obsidian sage
#

If I put my map-based Unity game up on multiple websites using WebGL, can each website have a starting location?

sweet oriole
teal beacon
astral wave
gleaming widget
#

Hey

#

I'm sorry to bother you all, but I'm having some problems learning Unity and I'd like to ask for some advice.

#

I used the official Unity "ThirdPerson" template, then switched to WebGL and had problems controlling the movement of the character.

#

Dose anyone know how to fix it?

novel cipher
gleaming widget
#

emmm, first, I download the official template "ThirdPerson", and everything worked fine, once I switch to WebGL, I can't move the person.

#

This is the only error reported

novel cipher
arctic rose
#

Did you do what the message says?

#

and you can clearly see another error below that

silk brook
#

where should I put this C# script ?

silk brook
#

does anyone acknowledge how to play video player on the online website services ? like itch.io & simmer.io ?

silk brook
#

it works fine on the runtime tho

cloud ermine
#

greetings !
can we increase WebGL Publisher limitation (200mb) with Unity Cloud service ?

sweet oriole
#

What is in your build?

south socket
#

i got this error when uploading a webgl build to itch.io

#

This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: br" present. Check browser Console and Devtools Network tab to debug

#

im on version 2022

cloud ermine
sterile coral
#

I need some help. I'm trying to get a WebGL build of my game, but it's not letting me access the player settings. Everytime I click the option, I just get a blank window with a dot in the upper left corner. This also happens if I access player settings through Windows and then click on the WebGL tab.

#

Note that everytime I try to access it, I get the following error code in the debug line that says "Index Out Of Range Exception"

#

Solved the issue...turns out I forgot to install the WebGL Build module

hardy panther
#

how can you implement browser-specific code?

#
#if UNITY_WEBGL
        _rotation.x += (Mathf.Abs(Input.GetAxis("Mouse X") - 0.05f) > 0.05f ? Input.GetAxis("Mouse X") : 0 ) * xSensetivity; // Attempting to prevent the firefox input drift bug
#else
        _rotation.x += Input.GetAxis("Mouse X") * ySensetivity;
#endif
``` I have these symbols that allow different code to be compiled depending on the build target, but I'd like to be able to tell what the user's current browser is so the code meant to counter a Firefox bug will only run on firefox
marsh dock
#

you'd have to write native plugin which will tell you browser/version

#

i'm not sure if there's something else available apart from user agent though / which is not entirely reliable /

charred briar
#

You can also pass JavaScript messages into the Unity WebGL blob and vise versa if you like

marsh dock
#

^ yea that interface is done via webgl native plugin as they call it (IIRC)

cloud ermine
#

guys anyone ever had this issues ?

arctic rose
#

Check the browser's JS console, like it says

#

But it looks like it's running directly from the filesystem which won't work regardless

sly wave
#

Hello everybody. Can anyone explain to me how browser memory is allocated in a webgl build? Which modules that I can find in the memory profiler are allocated in the browser ram? Only scene memory and assets? Besides the scene memory, how much memory is allocated to make unity work on a web page?
Thank you.

cloud ermine
cloud ermine
cunning shell
#

Does occlusion culling help improve WebGL performance?

charred briar
#

In most cases it should improve all platforms vs no culling - easy to test though to see by how much

cunning shell
charred briar
#

WebGL specially handles garbage collection differently but most other stuff is the same from a rendering perspective. So it should give you some improvements

#

It won't help with memory or package size but will with GPU drawing and likely reduce battery use

#

But I'm definitely interested if anyone else has benchmarked it

cunning shell