#๐ŸŒโ”ƒweb

1 messages ยท Page 7 of 1

charred briar
#

Sounds like a memory leak of sorts to me

craggy ruin
#

Yes, and I just tested a previous build of mine and that worked too as you said. So ig itโ€™s something with Unity ๐Ÿคทโ€โ™‚๏ธ

#

Or memory

sterile burrow
#

its iOS having extreme restrictions on RAM it seems

#

try and build your game on a lower resolution

#

that seems to fix it for us

#

at least atm

stoic tinsel
#

Is there a way for Unity 6 to put the โ€œwe donโ€™t run on mobileโ€ check back? References to where it was in the 2022 template might be enough.

#

My game is webgpu only so doesnโ€™t work. At least on iOS.

#

And also has a LOT of code which sometimes seems to make it die on load with โ€œstreaming compilation failedโ€

astral wave
astral wave
#

Also please have in mind the you should test on platform you have problems. One of main reasons is textures compression. For example if you test it on PC and your project is set to DXT format, memory usage will be lower than on iOS, as on iOS it will be decoded to RGBA, which is 4 times bigger format. This is extremely noticeable on VRAM, but I found that images size in memory (if not unloaded) can differ as well. I might be wrong here, but from my experience correct compression helped a lot with issues like that.

frank hound
#

It looks like your server isnt setup for brotli compression. If you are just testing on your pc using the standard build method, change your PlayerSetttings > Player > Publushing > Compression Format to disabled. Otherwise look into configuring the server for Brotli.

Also the setting above that will come in usefull at times to debug when set to Full with Stacktrace.

#

publushing... ๐Ÿ˜„ I may have been guilty of this b4

obtuse loom
#

Is there any way of exporting the localization assets... "raw" into the build? ๐Ÿค”
I want to change the localization without having to rebuild the game ๐Ÿค”
(I can probably do it by hand, with a json, but I lose the entire unity localization tools ๐Ÿฅฒ )

sweet oriole
obtuse loom
#

ohhhh, that could be exactly what I want ๐Ÿ‘€

polar spade
#

when i try to open my game in firefox this pops up

astral wave
#

I think red text explains it better than anyone could. you cannot Just open index html, you actually need to host it on server (you can have it localy). Or just press Build and Run on Unity, it will work then, as it creates temporary server to run at.

haughty lynx
#

Hey! I'm really struggling to understand the server configurations for brotli or gzip, my app runs without problems without compression, but I can't find any info for the content headers when hosting on something else than Nginx, Apache, and IIS servers (from the docs)

arctic rose
#

What is it running on then?

haughty lynx
arctic rose
#

You'll have to look up how to set up headers in those services and then add the necessary ones

#

It might not be possible in all services

haughty lynx
#

Yeah I tried to look it up but I don't think it's possible, what do people usually use to host webgl (own website not like itch.io)

arctic rose
#

I think the most common ones are itch.io for hobbyists and studios have their own server infrastructure

#

I know Firebase Hosting lets you set up the headers but it's a more involved setup compared to Netlify and similar

sweet oriole
haughty lynx
sweet oriole
#

I believe it says something about rules being applied when you deploy the site if it's able to parse the file

haughty lynx
#

The docs of netlify just says that the nelify.toml file must be in the root of the project, so alongside the Build, StramingAssets and other webgl files, and the format of the [headers] corresponds to their docs so I don't really know if it's a step I missed or it just doesn't work

#

Also when inspecting the network tab the files does not have the Content-Header: br (they do appear with http:// instead of https:// tho, but the error remains)

sweet oriole
#

Haven't done this in a little while, so I don't remember specifics.

haughty lynx
#

I see thanks, tried everything couldn't get it to work so I'll just keep that way for now and try the others ways.
Another quick question concerning webgl, when visiting my app on mobile the quality is horrible, but when I go into the web browser settings a click "request desktop device" quality is perfect (performances not affected), is there a way to have this quality by default?

edit: I could determine that it's because of the resolution, but I cannot find a way to adjust it as in webgl there is nothing in Screen.resolutions

edit 2: ended up fixing it with the display ratio within the index.html file

stoic tinsel
#

Just installed ios18 to test. Looks like still no WebGPU support?

tardy junco
#

Hi everyone, what do think is better to build the game like Seafight or Legend Pirates?
Unity or other such as Phaser, Threejs, Babylon, godot, etc...
Hope to hear from you.

astral wave
astral wave
# tardy junco Hi everyone, what do think is better to build the game like Seafight or Legend P...

All depends.

Are you targeting only web platform? or you targeting multiple platforms. If multiple platforms then Unity is amazing choice.
Are you going to use assets to speed up your development? Asset store have tons of out of the box solutions that you can use, Unity is good choice again.
Do you ant to work with editor with convenient features and a lot of features? Unity is great choice then.

Do you focus purely on performance and to run as many mobile devices as possible? Chose Playcanvas or others web based solutions.
Want project to be as small as possible? once again, maybe Unity is not for that.

As I said it depends on what you aiming for. You can create Seafight or Legend pirate on all engines you mentioned. I personally would choose Unity as I like working on Unity.

sour arrow
#

He was asking between unity,godot,babylon and perhaps unreal engine i think

astral wave
#

I understood that etc means: or any other engine. But my answer doesn't change, it all depends on what he needs. ThreeJS, babylon, Playcanvas is great for Web deployment, performance and project size is extremely good. But they lack in editor and features list. Unreal? I am not even sure worth to create Web application for it, it is just too demanding and for UE5, there is no official support if I remember correctly. Godot, it is great engine, and from gamejams information it replaced big part of Unity project (that mean webgl works, but how well, I don't know). And well Unity have problems with project size and memory limitations on older mobile devices is bit harder to optimize, but have very convenient development process.
The games he provided as examples can be made by all engines, what he targets is what important. So I cannot say: USE GODOT IT IS THE BEST, or something else. All have advantages and flaws.

sour arrow
#

No engine is as versatile as unity, so just use unity?

tardy junco
tardy junco
astral wave
# tardy junco I thought so like you Godot before.

I like Godot idea, and I think it ill grow to great engine. I am just not sure its current possibilities. About loading speeds, in most cases is more about downloading assets than actually loading. So you really need to be carefull with what you add in your project and use correct compression. Use addressables to load only things that you currently need, for example initial load to load only main menu scene, and load resources for gameplay only when you need it.

Also there are ways to strip Unity engine parts that you don't actually need in order to minimize the size and increase loading speeds. But that requires quite a lot of work.
https://github.com/JohannesDeml/UnityWebGL-LoadingTest

GitHub

Unity WebGL platform and version comparisons with a lot of nice extras - JohannesDeml/UnityWebGL-LoadingTest

sweet oriole
hollow light
#

Hey there. My boss needs a game exported in webgl. But he wants a javascript that can be changed even after the build. One that links to functions inside the build game. There seem to be many means of doing so. Any recommendations? I'm completely new to webgl.

arctic rose
#

Pick one that works and use that? This isn't the kind of choice that would have far reaching repercussions

rain frigate
#

Is anyone able to build with audio on Linux?

#

Windows builds web fine with audio

cerulean spruce
#

I am hosting a game server on multiplay which is using Mirror's simple web transport
my client is able to send request to the server and server receives it but after that the server restarts for some reason. Same setup is working locally but not on the hosted server.

One problem that i think could be cause problem is that i dont have ssl certificates setup locally, do i need to generate ssl certificate and set them up for wss connection? if not then what could be the problem?

rough spire
#

Hello everybody

#

I just have a small question

#

How do I embed my unity webgl build to my live website?

charred briar
serene quarry
#

Has anyone compared the performance of WebGPU and WebGL on Unity 6 preview (0.20f1)? I tested a scene with over 10000 draw calls and enabled WebGPU support in Chrome, but it seems that there isn't much difference between the two

hollow light
#

How do you guys use json to send payloads?

void canopy
#

why won't webGL recognise up and down inputs from the joystick but it does from the dpad?

hollow light
#

hey there. There is a mistake in this part, but I can't figure out what it is. Sitting on this for a few hours now...

    {
        let s = UTF8ToString(payload);
        let bufferSize = lengthBytesUTF8(s) + 1;
        let buffer = _malloc(bufferSize);
        stringToUTF8(s, buffer, bufferSize);

        return buffer;
    },```
sonic olive
#

Hello everyone, Iโ€™ve tried just about everything to solve this problem but canโ€™t do it. Iโ€™m very new to coding and this is my first project. I got this from a tutorial for 3d but my game is 2d. The problem is when i remove the item from my inventory it wont let me pick it up. it first I thought it was because it was a clone but the way he did it it uses a string to identify it. The clones still had the string saved so I don't know whats happening. Hereโ€™s a link to the โ€œgameโ€ https://github.com/Kalani12345/2D-game

GitHub

Contribute to Kalani12345/2D-game development by creating an account on GitHub.

arctic rose
arctic rose
hollow light
# arctic rose Does it happen specifically in WebGL only or why did you ask in this channel?

This is webgl | Unity 2022.3
I never tried it in any other context.
When I import it like this in my c#-script:

private static extern string testJsonExtern(string payload);```
I get this error:

This is the entire jslib-script for more context:
```mergeInto(LibraryManager.library, {
    setHighscore: function(payload)
    {
        let s = UTF8ToString(payload);
        s= UnityBridgeProfile.setHighscore(payload);
    },

    retrieveHighscore: function() 
    {        
        let payload = UnityBridgeProfile.retrieveHighscore();

        let bufferSize = lengthBytesUTF8(payload) + 1;
        let buffer = _malloc(bufferSize);
        stringToUTF8(payload, buffer, bufferSize);

        return buffer;
    },

    testJsonExtern: function(payload)
    {
        let s = UTF8ToString(payload);
        let bufferSize = lengthBytesUTF8(s) + 1;
        let buffer = _malloc(bufferSize);
        stringToUTF8(s, buffer, bufferSize);

        return buffer;
    },
});```
arctic rose
#

Is the jslib in a file with a .jslib extension and placed in Assets?

hollow light
#

Yup. The other functions work as well.

#

If i don't import testJsonExtern, that is

arctic rose
#

Did you save the file?

hollow light
#

of course.

arctic rose
#

Doesn't really make sense why the two other functions would work but this one not. Does it work if you change the name? Maybe "extern" messes it up

hollow light
#

Maybe.... Let me try that

#

... I found the error. I uploaded the project to github for my coworkes, but still edited the old file outside my the branch... God dammit.

#

It works... Yaaay... ๐Ÿ˜

sonic olive
radiant anchor
#

Hello i want to ask something im not sure where to ask but here is the question im using is AWSSDK and is the pre-signed-url feature is not working in WebGL? since after few debug the error always right there. Oh btw its works perfectly in editor its only doesnt works in WebGL build, Thanks

astral wave
#

does AWSSDK even support webgl? as if plugins is not in JS, it won't really work on Webgl. You should look if there is something like: Javascript SDKs of AWS

radiant anchor
#

oh my god right its not support WebGL

#

if using Unity Web Request does that mean the server need to be publicly accessible so unity can also get data from the server?

arctic rose
#

Depends what you mean by publicly accessible

#

obviously if you want to make a request to a server then you need some kind of access there

astral wave
radiant anchor
arctic rose
#

Not really

#

How can you access the data then?

astral wave
radiant anchor
radiant anchor
arctic rose
#

Well figure that part out first. Right now you're basically asking "there's no way to access data on my server. Can Unity get the data from that server?"

radiant anchor
astral wave
arctic rose
#

Also note that it's impossble to set it up so that only your game can access the server and nothing else

radiant anchor
#

Thank you all i will ask again about this later after i have more question, Once again Thank you

fathom patrol
#

I got this issue when the scene changes. (itch.io)

#

Not only scene changing. When I click game , I get that issue

arctic rose
#

See your browser JavaScript console for more info

cinder furnace
#

Hey, I've been getting this error/outcome inside a build only (it works fine in the editor) when calling a .jslib that awaits for the outcome of a popup, any thoughts on why it sees the popup window as closed right away even though it's not?

#
googleIdentityServiceInitializeCodeClient: function (initCallbackPtr, clientIdStr, scopeStr, callbackPtr, errorCallbackPtr) {
            googleIdentityService.googleIdentityServiceInitializeScript((err) => {
                dynCall('vi', initCallbackPtr, [googleIdentityService.allocateUnmanagedString(err)]);
            }, () => {
                try {
                    googleIdentityService.client = google.accounts.oauth2.initCodeClient({
                        client_id: clientIdStr,
                        scope: scopeStr,
                        ux_mode: 'popup',
                        callback: (response) => {
                            if (response.error) {
                                dynCall('vi', errorCallbackPtr, [googleIdentityService.allocateUnmanagedString(response.error)]);
                            } 
                            else if (response.code) {
                                dynCall('vi', callbackPtr, [googleIdentityService.allocateUnmanagedString(response.code)]);
                            }

                            
                        },
                        error_callback: (error) => {
                            dynCall('vi', errorCallbackPtr, [googleIdentityService.allocateUnmanagedString(error.type)]);
                        },
                    });
    
                    googleIdentityService.isInitialized = true;
                    dynCall('vi', initCallbackPtr, [googleIdentityService.allocateUnmanagedString('')]);
                } catch (error) {
                    dynCall('vi', initCallbackPtr, [googleIdentityService.allocateUnmanagedString('[WEB GIS ERROR] ' + error.message)]);
                }
            });
        },
graceful helm
#

does unity webgpu work with ecs? or itโ€™s mono behaviour only?

plush pawn
#

Hi guys

#

How do I get and output this data to Unity from Telegram?

plush pawn
#

Up

plush pawn
#

help guys

astral wave
amber ginkgo
#

hey, anyone knows the trick with CancellationTokenSource in webgl builds?

#

I call a _cts?.Cancel(false) where false explicitly states not to throw an exception, but in webgl builds it throws anyway

ObjectDisposedException: The CancellationTokenSource has been disposed.
  at System.Threading.CancellationTokenSource.ThrowObjectDisposedException () [0x00000] in <00000000000000000000000000000000>:0 
  at System.Threading.CancellationTokenSource.ThrowIfDisposed () [0x00000] in <00000000000000000000000000000000>:0 
  at System.Threading.CancellationTokenSource.Cancel (System.Boolean throwOnFirstException) [0x00000] in <00000000000000000000000000000000>:0 
plush pawn
astral wave
amber ginkgo
#

does it?

#

afaik it uses a simple data model where the data is managed and shared between asynchronous states. so any Task or async voids can access that data

astral wave
#

Webgl dont support tasks either. If you want use them you will need to use UniTask library for that.

amber ginkgo
#

just don't use functions that use different threads like Task.Delay. but others like Task.Yield() are fine. I've used them for years with no problem

astral wave
amber ginkgo
#

๐Ÿฅฒโ€Œ

astral wave
amber ginkgo
solar hound
plush pawn
#

hi guys

#

How do I connect Firebase to the game? WEBGL

plush pawn
#

help guys

amber ginkgo
plush pawn
amber ginkgo
plush pawn
amber ginkgo
astral wave
solar hound
#

@astral wave Thanks for the help, can you help me how to refresh the texture at runtime? I have tried this code but still not working on Web void Refresh() { SecondCamera.Render(); Graphics.Blit(SecondCamera.activeTexture, renderTexture); }

astral wave
#

This is texture settings that most definettly works on webgl. I am sure most of it does work, but just in case.

solar hound
#

@astral wave Hi, I did what you suggested by disabling and enabling RawImage and setting the value of RenderTexture the same as your image but still no render appears on the Web build(It works perfectly on Editor). you can see my code and RenderTexture setup. Thanks!

astral wave
solar hound
#

@astral wave I set RenderTexture to the camera in inspector not within the code

astral wave
solar hound
astral wave
solar hound
#

@astral wave URP Lit

astral wave
#

you will need to change URP to different shader, UI/Default or something. I am building right now webgl build to test, but shader is incorrect for sure.

solar hound
#

@astral wave ๐Ÿคฉ Its Work! Thank you so much

astral wave
#

Glad to hear it worked ๐Ÿ™‚ good luck

solar hound
#

@astral wave You save my day thanks!๐Ÿ™‚

amber ginkgo
#

Hey. Anyone used unity 6 webgl yet? Any particular bugs?

gentle epoch
#

i have a question
so if i publish my unity game with webgl
and after that i make changes to the game
the webgl game will be automaticaly updated?

sweet oriole
pastel bobcat
#

I'm suddenly getting this error for unity webGL. I've tried turning off toggling decompression fallback made it work for a day then the new build got the error again.
Worth noting that I'm getting the error on my old itch webgl games that used to work correcly. did itch change something?

pastel bobcat
#

please I need help. I need to get the webgl version running. I don't know if this is only happening to me. There is no reason for old working builds to fail like this. But they are failing even if I switch browsers or even devices

solar hound
#

@pastel bobcat select "Full With Stacktrace" and see the full log on the browser for error log

loud plaza
#

How are the build sizes with Unity6? Are they viable for simple 2D games on platforms like Poki, YandexGames etc?

cinder furnace
#

Still havent' found a solution

low oasis
#

In Unity 2022.3.20 version webgl build, a click sound is heard every time the audio loop repeats. How can I solve this?

#

anyone else having general audio issues

random talon
#

I have a PNG hosted on amazon cloud and I get it at runtime via a UnityWebReqestTexture.GetTexture(url)

#

It works fine on Editor

#

but when I load the webgl game on website like Itch.io I get CORS error

#

is it due to the site policies or Amazon security policies?

arctic rose
#

Amazon

random talon
arctic rose
#

Yes, the server must send the appropriate CORS headers with the image

amber ginkgo
#

hi.
we have deployed an upgrade to our web page which is a webapp, PWA and all that. it's a Unity webgl build, if that's important.
iOS browsers Safari and Chrome keep using the old JavaScript files from before the upgrade, even in incognito. is this a common iOS thing? are there any solutions for this?
I'm sending no especial header, but it's been more than 1 week since then now, and iOS browser still use the old version...

solar hound
#

Has anyone encountered this issue while building for the web It takes 20 to 25 minutes to make, and progress stops at linking build.js (wasm) for 20 minutes. Is there any solution for this? I am using Unity 6 LTS and the same issue occurs on 2022 LTS

amber ginkgo
solar hound
#

@amber ginkgo Previously on the same hardware and the same project, it takes 1 or fewer minutes to build.

amber ginkgo
random talon
#

is webgpu already available on unity6?

hazy mural
random talon
hazy mural
#

It's still experimental

random talon
#

ok thanks

honest swift
#

I have a build of the unity webgl game, but when I uploaded it to the hosting, it stopped loading after the initial download window appeared,what to do?

next kraken
#

Does webgl build support URP decal projectors? Desktop build looks fine but can't see the decals on webgl.

frozen quarry
#

Hey guys. i'm doing a small game in unity for a sort of game jam here locally, and they're asking us to make it playable on web, on itch.io. is there any limitations to this? Or can I just make any game use the extension and it'll be playable on web? Just a short game 10-15 mins, low poly.

#

I heard there was a certain build profile or something

sweet oriole
sweet oriole
#

Just make sure to test early in case you do happen to bump into something.

next kraken
woeful matrix
#

how do you guys normally debug webgl builds? I get an error in the chrome browser development console, but it looks gibberish.

Connecting to ws://127.0.0.1:8000

FishBait.loader.js:1 Invoking error handler due to
abort() at Error
    at jsStackTrace (http://localhost:3000/FishBait/Build/FishBait.framework.js.gz:4301:21942)
    at stackTrace (http://localhost:3000/FishBait/Build/FishBait.framework.js.gz:4301:22205)
    at abort (http://localhost:3000/FishBait/Build/FishBait.framework.js.gz:4301:992)
    at ___cxa_allocate_exception (http://localhost:3000/FishBait/Build/FishBait.framework.js.gz:4301:85538)
    at wasm://wasm/0b425e5e:wasm-function[1652]:0x135103
    at wasm://wasm/0b425e5e:wasm-function[1875]:0x144d68
    at wasm://wasm/0b425e5e:wasm-function[46099]:0xfbab7d
    at wasm://wasm/0b425e5e:wasm-function[119769]:0x27474d8
    at invoke_viiiii 
#

do you guys always enable exception with full-stacktrace for a webgl build?

obsidian cliff
# woeful matrix do you guys always enable exception with full-stacktrace for a webgl build?

Depends on the Unity version, you can make the names of functions more readable.

I think development build does it. But sometimes you want this to debug release build.

You can use
PlayerSettings.WebGL.emscriptenArgs = "--profiling-funcs";
Or edit the emscriptenArgs on the projectsettings.asset file.

More info here:
https://medium.com/@depanther/unity-webgl-secrets-b6ddf214f1fd

Medium

or Tricks and Tips for Unity WebGL and WebAssembly.

woeful matrix
coarse acorn
#

I have a problem with WebGL not using the camera's solid background color in fullscreen mode: (please ignore terrible UI scaling, thats a separate issue)

#

What am I doing wrong?

pine imp
#

I have a strange issue where certain animations are playing at a much slower rate in the WebGL build of the game than they do in-engine. Any ideas where I should start looking? The overall framerate is still normal, just some enemies' animations are playing at a lower framerate for some reason.

pliant magnet
#

Anyone have the issue of a game not updating on the website after making changes despite, doing a clean build of the game, replacing files, cleaning and rebuilding the app? lol

#

The game works with changes and everything if I just do a build & run as well as in the unity client itself, but i'm having a hard time figuring this out lol

astral wave
sweet oriole
#

"Name files as hashes" option in web player settings handles renaming Unity files for you

woeful matrix
#

so it seems websocket-sharp doesnt really work with webgl, whats a good alternative library for websocket networking?

sweet oriole
random talon
#

is it just me or Unity 6 webgl is very unstable?

#

I've tried to translate my Unity 2022.3 project into Unity 6 either by changing editor and by creatimg a blank project and reimport all but the I got stuck on webgl loading screen with no errors

solid river
random talon
#

Maybe its some dll I'm using but the console isn't giving me any useful info about the problems I'm having

#

and that is just with using webgl2.0, I haven't even tried WebGpu yet

solid river
random talon
#

I expected that upgrade to be way smoother

#

even cause my project isnt that big

solid river
random talon
#

they pushed it so much as Unity6 feature but officialiy is not completed yet

solid river
#

I see

#

yeah me too, i'm creating a mp shooter btw with NGO

#

nothing too fancy yet, just a web shooter

#

i read it's also a part of 2023.

#

lots of people with bugs tho xD

#

but maybe interesting to checkout soem latest messages, some people do have it working, also some talk about unity6

astral wave
random talon
astral wave
random talon
#

and I have no info in the console so I really dont understand what is going on

astral wave
#

have you tried loading in dev mode? and connecting profiler to it?

random talon
#

the only thing that I still need to do is connect the editor console to the build running

#

but I got quite demotivated at least for now since I'm seeing that a lot of WebGL devs are complaining about problems regarding the Unity6 project import

astral wave
#

I know it is stupid question, but are you sure than in scene list the correct scene is selected when you build?

astral wave
#

I had once after upgrading that it was not open scene inside, but had same name.

random talon
#

and before Unity6 the webgl worked on everything, even android and iphones (which was a mess to deal with but at the end everything worked)

toxic jewel
#

Anyone run into black screens + RenderPass: The dimensions or sample count of attachment 0 do not match RenderPass specifications in built games for WebGPU in Unity 6? I suspect it's related to render texture usage, though I've had similar projects work fine in 2023.3beta

uncut solar
#

I have been trying Unity 6, and using our custom WebGL Templates from previous versions, however keep getting a strange error that doesnt make much sense to me.
Preprocessor error "ReferenceError: USE_WEBGL_1_0 is not defined" occured in file "C:/Repositories/ProjectName/Assets/WebGLTemplates/CustomTemplate/index.html" when evaluating expression " USE_WEBGL_1_0 "

The documentation shows that it still exists, as it did in previous versions, anyone else running into this issue? or perhaps know what has changed so that its no longer recognizing it?
https://docs.unity3d.com/6000.0/Documentation/Manual/web-templates-variables.html

somber valley
#

**[Solved] **
Edit: there was an error inside the C# method being called but the thrown error wasn't being clear what the issue was.

~~I'm using this C# method to call the code in the jslib

public static extern void GetAnnotation(Action<string> result);
(...)
GetAnnotation(AnnotationsCallback); // call .jslib method

Then the method in the .jslib is called and I query a string from my database, which returns with success:

    var notes = await window.unityInstance.user.getAnnotation();
    var bufferSize = lengthBytesUTF8(notes) + 1;
    var buffer = _malloc(bufferSize);
    {{{ makeDynCall('vi', 'callback') }}} (stringToUTF8(notes, buffer, bufferSize));
  }

And this is the method it should call with makeDynCall:

[MonoPInvokeCallback(typeof(Action<string>))]
public static void AnnotationsCallback(string returnedStr)
{
    Instance.noteInput.text = returnedStr;
}

But the method is never called, instead I get an undefined exception on the browser console with just some random number.
These methods were basically copied from the documentation:
https://docs.unity3d.com/2022.3/Documentation/Manual/web-interacting-browser-example.html~~

arctic rose
#

Show the full error message

astral wave
#

and just in case write file location directory ๐Ÿ™‚

somber valley
arctic rose
#

Have you confirmed that it's not the user.getAnnotation call that's throwing the error? If you replace it with var notes = "test"; does it still throw?

somber valley
arctic rose
#

Which line throws the error then?

somber valley
#

maybe the random number was because it's unmanaged code being called

#

Also it seems like the correct way to make the string conversion is by using stringToNewUTF8

thin stone
#

just installed unity 6 to test out the improvements with web builds
https://discussions.unity.com/t/unity-6-updates-for-platforms/1529798

"Now, you can run your Unity games anywhere on the web without limiting your browser games to desktop platforms."
How exactly? The same way as before by installing Web as a build platform and building to Web?

#

"Additionally, you can embed your games in a WebView in a native app or use our progressive web app template"
That sounds cool but how?

#

Is there some kind of switch I need to flip or do I just make a Web build like I always do?

sweet oriole
#

Webview support is probably a similar situation.

queen dagger
#

Correct me if this is the wrong place to ask but is anyone working on or know of an existing game on the web that is a virtual world where you customize your character, chat with other people, play mini games, decorate a living space, things like that.

I already know about frog Paradise and hedgehog Creek! Thank you! Ping me your responses!

toxic jewel
# toxic jewel Anyone run into black screens + `RenderPass: The dimensions or sample count of ...

More detailed error for the black screen caused by render texture in WebGPU:

[Texture (unlabeled 640x360 px, TextureFormat::RGBA8UnormSrgb)] usage (TextureBinding|RenderAttachment) includes writable usage and another usage in the same synchronization scope.
 - While validating render pass usage.
 - While finishing [CommandEncoder (unlabeled)]. Project.framework.js.br:9

[Invalid CommandBuffer] is invalid.
 - While calling [Queue].Submit([[Invalid CommandBuffer]])
astral wave
# queen dagger Correct me if this is the wrong place to ask but is anyone working on or know of...

https://theportal.to/
I think one of better examples. Well it is full of crypto, but some people like it. There are others metaverses as well. Most of them have some or all of these features. If needed i can give more, but they are quite behind in comparison with theportal.to. Also it is created on unity so you will get good image what can be done. Sadly it does not work on mobiles, at least yet from what I remember.

queen dagger
astral wave
astral wave
#

so most of them I saw was remote office, like "Gather" and etc

queen dagger
surreal marlin
#

Has anyone ever gotten an error like this in a WebGL build?

Ive been searching everywhere but cant find a fix

My project is pretty barebones
Works in the Editor on Web Platform and with multiplayer mode

Unity 6 LTS

arctic rose
#

If you've made your own JS plugins you'll have to use makeDynCall instead of dynCall. If not, you'll have to disable the WebAssembly.Table option to make the old dynCalls work

surreal marlin
#

I havnt made any js plugins. Just unity 6 and the multiplayer sdk really. Where would I find and change this?

arctic rose
#

Edit > Project Settings > Player

twilit sluice
#

Is there a way to host the .wasm file in a different location than the rest of the game? I tried editing all the references to build.wasm to just https://example.com/build.wasm but that doesn't work

twilit sluice
arctic rose
#

You'll need to set the correct headers for the wasm file server, at least CORS headers and content-encoding if it uses Brotli compression. But it depends what the error is.

#

For the splash screen, you'll probably have to wait for an editor update

orchid bridge
#

heeeelp it keeps happening

#

I already installed IL2CPP from Unity Hub

orchid bridge
#

wait.. it seems to just be VPP messing up. The Professional edition has it fixed but they didn't update the Community version

faint ice
#

I am trying to build DOTS Project for webgl but it keeps crashing. Is DOTS still not support for webgl?

twilit sluice
sweet oriole
#

Jobs and Burst generally range from not being very effective to being unsupported, but I imagine they have fallback mechanisms that get a lot more testing.

brave thicket
#

How can I send browser push notifications from a WebGL game or my backend, can't quite find info on it in Unity, I assume the game would need to ask for permission first?

arctic rose
#

You'll have to research how to do it in Javascript and make a JS plugin

random talon
#

Do somebody have knowledge on using the NativeWebSocket library?
I'm using it to enstablish and manage a websocket connection that works also on WebGL build.
It worked like a charm until I added a header, in this game the connection only works on editor

twilit sluice
#

Hello, can someone help me with getting the Unity player on a custom site? I tried pasting the html to the right part and the stylesheet to the <head> part, and it does work, but it doesn't show the full screen button

#

So I copied the part between <body> and </body> to the right part of the html and I copied the <link rel="stylesheet" href="TemplateData/style.css"> to the <head> part

chilly narwhal
bright galleon
#

Hey, when using webGL build on a website i often get an error in the console saying:

still waiting on dependencies
dependency: wasm-instantiate
(end of list)

and the game is stuck on the loading screen. Any idea how to fix this?

tall lantern
#

Does somebody know how to fix this error. I am trying to build on WebGL with URP on 2023.2.20f1

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Rendering.RenderPipelineGraphicsSettingsStripper.PerformStripping (System.Collections.Generic.List`1[T] settingsList, System.Collections.Generic.List`1[T] runtimeSettingsList) (at ./Library/PackageCache/com.unity.render-pipelines.core@16.0.6/Runtime/Stripping/RenderPipelineGraphicsSettingsStripper.cs:43)
UnityEngine.Rendering.RenderPipelineGraphicsSettingsContainer.OnBeforeSerialize () (at ./Library/PackageCache/com.unity.render-pipelines.core@16.0.6/Runtime/RenderPipeline/RenderPipelineGraphicsSettingsContainer.cs:44)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
outer rampart
#

Update Unity to the latest Unity 6 LTS @tall lantern

rapid oasis
#

Hey guys, we are trying to deploy to webgl a game online and i seem to be having issues with Iphones, i know they require ASTC compression but for some reason they still are not able to run it the pages say a proble repeatedly occured, works fine on dekstop, works fine on android

woven ibex
#

hi gang

#

it's working nicely, except for loading the file

#

made a thread to avoid flooding

#

the error I'm getting says that Unity is not initialized

#

this is where my console on the browser is referring me to

woven ibex
woven ibex
#

also, do WebGl lose quality when built? ๐Ÿค”

astral wave
# woven ibex also, do WebGl lose quality when built? ๐Ÿค”

this one answer is: it depends ๐Ÿ˜„

  1. when you build there a specific build options that will compress your textures to specified quality and format. Which could lead to some noise and quality drop after the build.
  2. When you build and run webgl, you will notice that the window resolution is quite different from what editor runs at. And the comes the real enemy -< SCALING. And scaling can cause really a lot off quality problems. Like image instead o 512x512 becomes 269x269, where you lose data and some pixels can look different making it look bad. It can be solved with adjusting html code and build options.
  3. by default project have quality settings: high, medium, low. And they are set to be default different depending on the platform. So in short on webgl it might change to lowest quality settings option ๐Ÿ™‚
astral wave
# woven ibex

it is always better to check console for more precise error. (f12 on chrome for example). Make sure to check there, then make sure the loading order of you script is correct, like unityInstance is not defined after actually using it. And check the template code, as unityInstance name changed depending on unity version.

woven ibex
#

well all I get is this

astral wave
#

https://docs.unity3d.com/es/2018.4/Manual/webgl-interactingwithbrowserscripting.html

https://docs.unity3d.com/6000.0/Documentation/Manual/web-interacting-browser-unity-to-js.html

make sure you template have something like this:

  var unityInstance= null;
  script.onload = () => {
    createUnityInstance(canvas, config, (progress) => { /*...*/ }).then((unityInstance) => {
      unityInstance= unityInstance;

Aka make unity instance into global variable that you can easily access.

woven ibex
#

that's my... html thing?

#

the
index.html

woven ibex
#

I don't get this much... it's my first time using webgl

astral wave
woven ibex
#

I assume it is the index html

#

the zip is to upload on itch

woven ibex
#

where would I put that exactly tho?

astral wave
#
createUnityInstance(canvas, config, (progress) => { <..> }).then((unityInstance) => {
      unityInstance = unityInstance;}

and write other code you need. Or something like that.

If you would using unity 6 template you could see something like this:

script.onload = () => {
        createUnityInstance(canvas, config, (progress) => {
          document.querySelector("#unity-progress-bar-full").style.width = 100 * progress + "%";
              }).then((unityInstance) => {
                document.querySelector("#unity-loading-bar").style.display = "none";
                document.querySelector("#unity-fullscreen-button").onclick = () => {
                  unityInstance.SetFullscreen(1);
                };
<..>```

which gives you place where to look.,
woven ibex
#
var unityInstance;
      createUnityInstance(document.querySelector("#unity-canvas"), {
        arguments: [],
        dataUrl: "Build/Jaro TCG - Web DeckEditor.data.br",
        frameworkUrl: "Build/Jaro TCG - Web DeckEditor.framework.js.br",
        codeUrl: "Build/Jaro TCG - Web DeckEditor.wasm.br",
        streamingAssetsUrl: "StreamingAssets",
        companyName: "Devour Labs",
        productName: "Jaro TCG - Editor de Mazos Web",
        productVersion: "0.1.0",
      }).then(function(instance) {
        unityInstance = instance; // Assign to global variable
        document.getElementById("loadingMessage").style.display = "none"; // Hide loading message
        console.log("Unity instance created successfully.");
      }).catch(function(error) {
        console.error("Failed to create Unity instance:", error);
        document.getElementById("loadingMessage").innerText = "Failed to load Unity app.";```
woven ibex
#

I used chatgpt for what you told me, I haven't tried yet but will soon

#

I bet something else will now have an error but at least is one step in the right direction xD

astral wave
#

yea chat gpt likes dream a bit on unity webgl ๐Ÿ˜„

woven ibex
#

tomorrow I'll check back on this and take a look at what you sent

#

thanks for caring even if it doesn't work, I appreciate the effort xD

#

also would like to know where exactly I should look into to make my cards look clearer

woven ibex
#

I tried changing the texture compression format and such... that took one hour and made no difference xD

astral wave
# woven ibex

first check quality settings and platform connection in player options /quality ->

There green color indefies which quality setting is default. And icon with small 5 (last icon) means WebGL platform.

woven ibex
#

fire! thx dawg, I'll check those out

#

time for bed, sweet dreams everyone

tall lantern
worn flint
#

Researching if Unity's new input system doesn't allow key rebinding in WebGL, or if there is any documentation on keyrebind WebGL specifically.

sweet oriole
solar hound
#

Hello friends, I have a cache issue in my WebGL build. I update my app on the server a few times a week and can not see the updated version without a clear cache in the browser. Here are my WebGL player settings. I want my app updated when I upload the latest build to the server without manually refreshing the cache. Please help me!

torn pagoda
solar hound
#

@torn pagoda that's correct we can not handle browser caching from the Unity side, but I update my app daily so it is necessary for users to clear previous caches to get the latest version.

torn pagoda
#

Again, thats a server issue on the config, how long it will store the latest build or on the users browser. I think, you need to serach for some website specific cache configs or server side configs to change instead of the unity build settings

sweet oriole
#

Cache busting of files other than the ones Unity builds needs to be handled separately, but the strategy would be the same.

ancient dirge
#

Can anyone help me uploading game on Telegram

winged copper
#

what is the best format to use for video in unity webgl

thin stone
#

I've uploaded my Unity 6 web game to Itch.io and tested it on Brave mobile browser & Chrome mobile browser and it works fine but on Firefox it doesn't correctly rotate into landscape mode, it says in portrait mode, and in Edge browser there is no sound.

Would anybody happen to know how to make the game more compatible amongst all the different mobile browsers? I guess it comes down to the browser's privacy and media autoplay settings?

low oasis
#

Using Unity 6, still have pop sound when loop sound
How to solve this?
I want to make seamless sound loop

#

Result should be like this

halcyon hedge
low oasis
#

ok

low oasis
#

1 sec beep

#

This sound has no empty area

halcyon hedge
#

it working fine here

low oasis
#

Did u build already?

#

My editor is working well, only web build has issue

halcyon hedge
#

its building now

low oasis
#

This is my setting for isolate testing in blank project

#

Didn't touch anything in the audio import setting

#

Building

knotty yoke
#

Hi, so, maybe my question is best asked here.
I'm trying to hook google analytics into Unity for a desktop game so I can publish it on itch. All information I can get about how to do it is aimed towards Android and iOS. Does anyone know how to do it or share a link to a website/video that explains how to set it up?

thanks!

arctic rose
knotty yoke
arctic rose
#

What app setup?

knotty yoke
#

this thing here.
Some context, I've always used in-house analytics so I'm not sure how to set up and work with firebase and google analytics.

arctic rose
#

Use the web app template (</> button)

knotty yoke
#

oh ok, so just normal web and doesn't matter if it's unity or not, got it. Thanks! ๐Ÿ™‚
Do you know by any chance if doing this would work for desktop apps?

low oasis
#

Same issue on blank project

arctic rose
#

Yes, all of them do the same thing. The only difference is what instructions it shows after adding the app

low oasis
#

@halcyon hedge how about ur?

knotty yoke
low oasis
halcyon hedge
low oasis
#

I'm using SSD but was too long

halcyon hedge
#

โณ

low oasis
#

Are you using HDD?

#

HDD was too slower than SSD

#

I found some asset package is postprocessing audio, so removed all and try re-build

halcyon hedge
# low oasis Are you using HDD?

no Im just doing it normally but my laptopfroze and I think it interrupted the process. Im just going to try my desktop, be back in 10

low oasis
halcyon hedge
low oasis
halcyon hedge
#

the pitch is also lower

low oasis
#

in editor it is seamless

#

but only web has that pop sound

low oasis
#

web build force to usc AAC compression

halcyon hedge
#

yes there is a higher pitch in the editor but its a lower pitch webgl

low oasis
#

hm then it is issue of AAC ompression in the unity it self.

#

also did u hear pop sound?

halcyon hedge
#

not so much of a pop but yes its like a silent space

low oasis
#

oh so this was unity bug

#

Thank you so much to testing

halcyon hedge
#

idk if its a bug or just wrong exporting settings, I would need to try different things around settings and see further whats going.

low oasis
#

There are few option to change setting here

halcyon hedge
low oasis
#

I assume unity compress audio format to AAC, but it make small void area

#

I can only see this setting

halcyon hedge
#

apparently Unity uses heavy modded verison of FMOD but in webgl they dont

low oasis
#

That would be reason

#

Then If it is caused by leak of FMOD in webgl. I think there is no solution now?

#

I found all supported audio format

#

and I remember mp3 had more delay for each loop

#

forum suggest to use wav to seamless loop. and i also test .ogg, it is also not working

halcyon hedge
#

thats whats causing issues

low oasis
halcyon hedge
#

yes it sucks that web is this way, but it is what it is

low oasis
#

if mac build works well, i think it was also working well on your laptop

#

by the way, i found FMOD with unity web

#

I didnt understand this 'Support for WebGL is included with the base integration'

#

FMOD support WebGL basically?

#

Also found official sample

halcyon hedge
#

You can try it and see

#

cause the docs says this

Because Unity uses FMOD
to manage audio for platforms, the Web platform supports limited audio functionality, which only includes the basic features. FMOD relies on threads, which the WebGL
API doesnโ€™t support. For this reason, Unity uses an implementation based on the internal Web Audio API, which enables the browser to handle audio playback and mixing.

low oasis
low oasis
#

So I just should fade in / out audio start and end

sterile burrow
#

Im facing a weird issue with WebGL builds on Safari. It seems to be a Safari bug of kinds.

What happens is on first load, it will load the game in to memory, but after every consequent reload, it just adds more and more to the memory unless i complete shut off safari and re-open it..

It get's more weird though, i've tried refreshing the game a couple of times (going from 600mb, to 1gb, to 2gb, to 3gb, etc..) and then switching to another domain (nu.nl), in which case suddenly, the nu.nl safari page keeps using a whopping 6gb of RAM and keeps automatically growing without me even doing anything.

I've attached screenshots of my mac Activity Monitor, to show it growing as I reload, and the switching to nu.nl and it continueing to use so much RAM..

(3 reloads on game, then switching to nu.nl, then a couple of seconds after nu.nl load)

radiant anchor
#

Hi Im wondering is there's any function i can use to clear cache of my webgl game?
So the problem is if user already open the web(im using AWS s3 bucket) then i update the web, the user wont get updated build and user need to clear cache of that web first to get that updated build, so i want to solve that issue, is there's anyway i can do to achieve this?

radiant anchor
#

i research a bit in unity discussion and some of them said delete IndexedDB.deleteDatabase, but when i tried it said Database Detection Blocked: /idbfs
Database Detection Blocked: UnityCache
And yes that 2 is the one i need to delete based on unity discussion i read, any idea on this?

thin stone
#

not sure whether to post this here or in #๐Ÿ“ฑโ”ƒmobile but i published a unity 6 web game on itch.io intended to be played on mobile and it works on brave browser and chrome but in firefox it doesn't go into landscape mode properly, is there a way to fix this?

i tried Screen.orientation = ScreenOrientation.LandscapeLeft; but it didnt do anything

burnt linden
hardy hamlet
#

how would i make a webgl file of a unity game

#

it was pc mac platform

#

now i put it to webGL and it bombarded me with errors

#

when i tried to build it

lunar ibex
# hardy hamlet now i put it to webGL and it bombarded me with errors

Deal with them? It's a bad practice to tell that you are getting errors without specifying them. As far as I know not every aspect of unity can be utilized on WebGL, so you might be having to redo something. Also, I might be wrong, but you are never getting a webgl file. You re getting a Build in a folder with... subfolders and stuff in it.

gleaming cape
#

Hi guys, i have a question. In our current company we are planning on publishing our games on our own site and so we need to show game ads, since sites like Poki etc provide their own sdks for ad integration, is there any sdk available that is not attached to a publishing platform for webGL? something we can use independently?

sweet oriole
hoary rose
#

Okay, this is a bit of a stretch, but I'm out of options and I can find nothing online that works. Has anyone here ever managed to get a Unity WebGL build running in a Blazor Web Application? I'm pretty sure I've got all the files in the right place, but it's giving me a 404 when trying to load the JS. I've put the build directory in wwwroot and added the contents of the index.html to the page I want, but it just isn't loading anything.

The closest I've found is this discussion but I have zero idea what the solution means, I know Unity not Blazor.
https://discussions.unity.com/t/unity-built-for-webgl-embedded-into-a-blazor-application-wont-instantiate-properly/730703

junior basalt
#

Is there an ETA on when WebGPU will come out from experimental? And is there a roadmap that provides info on what would be a prerequisite for it to graduate from experimental?

sweet oriole
hoary rose
#

I don't have access to it at the moment to confirm that, so I'll double check tomorrow to confirm, I might have just made a mistake somewhere with the pathing

sweet oriole
amber ginkgo
#

hey, that's a question I just created. didn't re-write it to void spam. would appreciate help on this ๐Ÿ™

sweet oriole
amber ginkgo
#

oh let me add this to the Discussion topic too

sweet oriole
#

I can imagine Safari becoming even more aggressive if it ever goes to background

amber ginkgo
amber ginkgo
amber ginkgo
#

i haven't seen similar issue on any other device than iOS

#

i partly think it might be a config issue

#

suspect this as well

#

will test with it as 1GB

sweet oriole
#

Maybe other people have some tips. The aggressiveness does seem unique to iOS.

amber ginkgo
amber ginkgo
#

changed the player settings' memory alloc settings to start from 1000MB and incrase with up to 1000MB at a time with a 1:1 ratio. that seems to have increased the crash/reload threshold to ~880MB :|

amber ginkgo
#

ok now with the new player settings, the actual game runs fine too... so all this time it wasn't the 500MB mem limit, it's the allocation strategy that hit a limit that it had internally set for itself

#

here's the settings. in case any future webgl dev needed it

hoary rose
#

Oh, hang on, I think I found it, making progress...

#

Woohoo indeed!

restive mica
#

hey, how can I run my unity project on my own website without loading Unity Play?

arctic rose
#

Compile the project to WebGL, upload to website

restive mica
#

I have published and build the project using WebGL, but I don't know how to proceed further

#

I've tried adding the embedded code i.e. the iframe through the webpage but it loads the Unity Play page, tried to host the index file on python but it shows the https restrictions

sweet oriole
silver reef
#

hi, sorry to my eng.
I have question for optimizing Simulation in WebGL.
As I Know, WebGL using Unity does not support DOTS (except ECS).
and Multi Threading also.
recently I found some clue for multi threading using Native PlugIn.

And I read Native PlugIn DOCS. docs shared some rendering example project using DirectX renderer.

these solution really faster, efficient than Unity Rendering?

And
Some Company suggest, Use Rust PlugIn at Unity, as MultiThead ECS machine. And Then, they make 10K Object Crowd Simulation In WebGl.

It is really possible..?

sweet oriole
# silver reef hi, sorry to my eng. I have question for optimizing Simulation in WebGL. As I Kn...

You can't just start executing native code simply by someone visiting your website for security reasons. You might be able to hack the browser to do this if you control the machine used to run the browser, but at this point you might as well build and run a native build.

What are you trying to build? What is your bottleneck?

Fastest running solution is always the one that is specifically made for your problem, but that can require a lot of investment.

silver reef
#

thank you replying.
if security problem exist, maybe these approach will be wrong...
currently, we make our digital twin platform for goverment.
we make predicting population risk and control using realt-time/ time series data.
Simulating Crowd / Traffic / Shipping will be good point for customers.
so, I trying to rendering many population object as possible as.

my bottleneck simply in my desire for displaying so many objects.
currently, my limitation performance is 40~50 FPS, Draw Call was only about 4000. (each object has 3,000 vertics object.)

thorny ember
#

I have been running the unity profiler for a webgl build. All the assets highlighted in red are 3rd party assets in my file tree but are not used in any scene. When I inspect with find in scene it returns nothing. How is it possible for objects end up in RAM despite not behind used in any scene?

sweet oriole
sweet oriole
#

Engine multithreading should work as long as you don't need to embed the build on other sites (CORS reasons).

jade garnet
#

Hello, I have keep having an interesting but simple issue with my build, I think....

Anyways when I build to web and upload the project I can see everything in the scene on my computers web browser, but for some reason when I pull it up on my mobile phone none of the models show up. I even changed the materials on them to mobile compatible shaders, this did not help, I also checked to see if they were actually in the scene with a dbug log printed to a UI text field. I am not getting any errors. I am using a blank scene with 3 default object in it.

If anyone knows what I could try, the help would be gratefully appreciated.

Web: Mobile:

astral wave
jade garnet
# astral wave did you get the UI text on the screen successfully? Have you tried if you can se...

I can see UI just fine, but it's something with the textures, the objects are not being displayed.

Also using URP, and it's not a bowser issue, I tested it on several and it was only phones that were affected.

I was able to get them working by using other textures than the default ones. But I was hoping I could fix it without using other custom textures, because it just adds more to the process oh well.

astral wave
jade garnet
astral wave
#

In order to debug this problem I would start with step by step approach. It will take time but you will know where exactly problem come from. Start ne project, add one object with default material. See if that works on your phone. Then keep adding your objects one by one, try doing as small steps as possible to find which step exactly causes the problem. You can also try adding your textures or materials that works by default. This way you can confirm if that is texture problem shader problem, project settings problems.

jade garnet
dapper jewel
#

Although on it's only spread out to 4 worker threads compared to when I'm running it natively. I have a 12600KF (10 cores, 16 threads)

#

So...jobs sort of technically works? Here's a build with multithreading turned off

sweet oriole
dapper jewel
stoic tinsel
# dapper jewel I'm confused, according to this post https://discussions.unity.com/t/web-build-w...

Wait really, does that actually work and you're profiling the browser, not the editor with WebGL build profile active, there?! If so that's very interesting, because I was about to write a load of C++ for some WebGL multithreaded stuff, and want to know if I can actually do C# (interestingly not because I dislike coding in C++, but because I hate CMake...)

Are your jobs burst-ed? Theoretically, the problem with WebGL Multithreading is (as I understand it) the garbage collector. Now, since burst can't create garbage, is it possible that bursted webGL jobs can actually be run on worker threads? If so, that would be amazing... but I can't understand why Unity would have enabled that without announcing something so awesome.

dapper jewel
stoic tinsel
#

Interesting and... surprising... I was sure I did some tests early in Unity 6, and Unity.Jobs.LowLevel.Unsafe.JobsUtility.JobWorkerCount was always 1 in WebGL builds no matter what you did. Running a test now, but on the other hand, I'm not sure how this fits in with the GC in WebGL (which has its own ickyness that it can't run mid-frame, some of our larger loading/init tasks that generate lots of garbage even have await Awaitable.NextFrameAsync() scattered through them to let the GC run, because otherwise on Web it won't and our high water mark is too high...)

stoic tinsel
# dapper jewel Yup I profiled the app running in Chrome - it didn't burst compile though. You c...

Yeah, you're right - Unity now (6000.0.26) reports 5 for Unity.Jobs.LowLevel.Unsafe.JobsUtility.JobWorkerCount in chrome! Which seems amazing, but I can't repro what you're seeing with jobs in parallel because even the simplest IJobParallelFor Dispatch I can do seems to crash with "call stack size exceded" in WebGL. Are you using IJobParallelFor there? Or IJobFor? Any other details to repro a minimal verion of you have?

dapper jewel
dapper jewel
stoic tinsel
#

Thanks. I'm not currently able to run your test either, going to try a new project, in .28 instead of 6000.0.26.

#

I've definitely got C++ multithreading on - lots of my embedded C++ plugins fell over when I enabled it because you need to recompile any wasm libs you've built with different flags (which will mean a load of vcpkg / cmake misery...)

stoic tinsel
#

WebWorkers

solar hound
#

how do I force open my webgl build always in landscape mode

charred briar
#

Orientation is dependant on the browser

#

What I usually do is show an overlay on portrait that tells the user they need to rotate their phone

amber ginkgo
#

Hey!
On iOS our web game gets reloaded mid-game. Not even opening other tabs or apps. I've made sure the game pre-allocates all the RAM it'll need so there's no sketchy big alloc happening that would make the browser optimize the tab away. Also, game's not that demanding, and I don't get any errors for the reload so it's not a software crash either...

Anyone has any suggestions on where to look?
The issue started happening after we added a ton of new vfx, so VRAM is probably twice more occupied than before, but CPU and RAM wise nothing has changed between the working and the not working versions. Also, the vfx are just using a simple additive texture shader and they're instanced heavily using Unity's particle system.

reference: demo.crownchaser.com (game's entry code is cc-entry-secret)

Some more info that might be helpful

  • pre-allocated ram is 1GB , the crash happens on iPhone 14 pro which I believe has 8GB , and the error happens with no other app opened, so at least 4GB free.
  • I can't seem to replicate the issue on clean iOS installs on live iOS testing websites (they don't let me install a lot of apps to replicate a busy OS and then close them all to replicate the scenario)
  • The crash happens during the demanding scene where all the new vfx are loaded. I've benchmarked the internal allocator (which simulates allocation, but really it's just using the pre-allocated memory internally. It's a Unity feature so it's solid) and the demanding scene tops at around 400MB of ram, nothing too big.
  • I have no idea how to benchmark VRAM on web, so I have zero info on that, but if needs be I'll provide some, given it's possible that is, because it may really be a blackbox.
astral wave
# amber ginkgo Hey! On iOS our web game gets reloaded mid-game. Not even opening other tabs or...

First to be sure, you don't try to use VFX graphs right? As webgl don't actually support that..

Your problem sounds very much one we had. Things that I learned about it:

  • pre-allocated ram memory that browser reports don't really matter in this case
  • you need to use Unity memory profiling on your game to see how much memory it actually uses
  • when you reach about 300-400 mb RAM usage, unity webgl becomes unstable and starts crashing/reloading. This limits is for iPhones 15 and older (android don't have this problem), newer devices don't seem to have it, or the limit is higher.
  • other webgl platforms like PlayCanvas do not have this problem. It seems it is something with wasm. if you search you will find a lot o people complaining about it.

So that is my guess what happening to your app. I really suggest to connect Unity profiler and check what exactly happening

solar hound
amber ginkgo
# astral wave First to be sure, you don't try to use VFX graphs right? As webgl don't actuall...

hi. no vfx graph, it's all either shadergraph or raw shaderlab script.
Thanks for the thorough reply! ๐Ÿ™
in our testing, the game uses just above 500MB of memory at max, but also in a benchmark I wrote, the tab could allocate up to around 800MB of ram before the browser killing it. And even then, it would kill it with an error message, not a tab reload. Right now the game tab just straight up reloads, no error, no special logs, nothing. it just reloads ๐Ÿฅฒ

+++ We did have a memory issue and it was pretty much like you desribed. But we solved that before and the game was running fine at <500MB ; the new "reload" problem only started happening after we added a lot of new vfx (which still don't cause the memory to go beyond 500MB, and even if it did, definitely not beyond 800MB. What's more, we preallocate 1000MB anyway so no alloc/dealloc...)

#

I suspect that as much as this issue is similar to the infamous RAM issue, it might be related to something else, say, VRAM?

strange grove
#

I have a webgl 3D game. Im currently on a prev version of unity rather than unity 6.
The problem i have is that if i upgrade it to unity 6 my game crashes on IOS after 11 - 12 rounds. But it doesnt crash on the current version even after 30-40 rounds.

what can be the issue here? if anyone has any idea

astral wave
# amber ginkgo hi. no vfx graph, it's all either shadergraph or raw shaderlab script. Thanks fo...

Out of interested, how did you solved that issue? It indeed sounds really really like RAM reload and relocate issue we talked, no errors, just reload on iOS. As preallocating more memory did not solve that issue for me, as I told, browser and iOS memory usage are bit different issue.

Coming back to your issue tho, Are you using addressables or something like that? You could test VRAM usage with profiler, set everything to lowest quality and see after reducing usage of VRAM does crashes still happen.

astral wave
# strange grove I have a webgl 3D game. Im currently on a prev version of unity rather than unit...

Well, the answer would be profiling. As you have pretty specific crash time zone, so you can test it. At crashing point check what resources are being used, maybe you have memory leak somewhere, and each round keeps loading extra assets or textures over and over again. I haven't personally noticed any crashes with Unity 6 yet, but in your place I would:
a) check quality settings and build settings. As unity 6 added new stuff, they might be automatically enabled and using more resources than usual in older version. And then you hit iOS limits.
b) After upgrading I would delete library folder and start Unity again to rebuild it from scratch. Sometimes it causes weird bugs as old compiled code don't flow with new code.
c) triple check build settings

Is there any errors on crash? you can check logs with chrome://inspect in different tab to see logs you get.

strange grove
#

Sure will check that

amber ginkgo
strange grove
#

I did use brotli

#

Im using urp as well which causes fps drop on android too

#

Will look into it

amber ginkgo
#

++ on the question of what I use for memory management, I use Resources. I profiled it and it does handle memory properly

#

after the addition of editor-only serializable fields in Unity 2023, I've found writing my own Resources wrapper is a lot better than using Addressables. You also get all the Editor goodies with exposing editor-only object reference that doesn't get into builds

astral wave
#

Do anyone knows if:

  1. Does new input system support multi touch actions like pinch on WebGL?
  2. Is there a way to simulate pinch action on editor to test if code works?
amber ginkgo
astral wave
charred briar
#

Fwiw it looks like it's trying to remove shaders and some badly tested unity build code couldn't find it, and errored

tranquil willow
#

Hii, I tried publishing a WebGL demo of my game on itch.io but it refuses to load. After getting multiple erros in the browser and trying different solutions I went with uploading to Unity Play and it works fine. Is there something I'm missing when it comes to itch.io WebGL hosting? Thanks

arctic rose
#

You'll have to show the errors

amber ginkgo
tranquil willow
orchid bridge
#

what can I do about webGL having pink shaders?

#

its a certain asset pakc that isnt rendering shaders

#

how do I force it to do so

#

it also doesnt seem to have rendered any lighting or fog

astral wave
#

who knows what features e is using for those shaders. If he using anything with compute shaders, you are out of luck. or any other thing from long list webgl doesnt have.

orchid bridge
#

pain and suffering

#

thank you for the response

#

see if it would render

#

I was gonna try to do this

astral wave
#

if you do not use addressables or other resource management tools, than all shaders should be included in build automatically.

orchid bridge
#

I dont

#

idk, ill try it cuz im desperate to not have to use default shaders

#

but if it comes down to it I will

#

thank you v much for your help

outer wave
#

I'd dig for errors like I've mentioned before. It'll probably tell you what operation the shader did and why it failed usually

#

like incorrectly sampling depth, ect

orchid bridge
#

could it be any of those?

#

idk how to read this stuff very well honestly

#

I didnt program anything about the game

#

I was the artist :^)

outer wave
#

HDRDebugView I doubt is your shader

stoic scroll
#

What shader are you using for your skybox?

woeful matrix
#

Unity 2022.3.37f1 - Im getting a "memory access out of bounds" error on my webgl build when running on the browser. The first time I load the app, everything works fine, but when I hit refresh, and load the website again, it crashes with that error message. It crashes in the middle of loading unity. I've tried doing a clean build, and same thing happens again (first load works, subsequent crashes)

Uncaught RuntimeError: memory access out of bounds
    at il2cpp::vm::MetadataCache::Initialize(fishbait-web/) (http://localhost:3000/fishbait-web/Build/fishbait-web.wasm.gz)
    at dynCall_i (fishbait-web.wasm.gz:0x71f7654)
    at Module.dynCall_i (fishbait-web.framework.js.gz:4301:372313)
astral wave
# woeful matrix Unity 2022.3.37f1 - Im getting a "memory access out of bounds" error on my webgl...

I always mixing memory out of bounds errors, which is which.
As one is caused when you try to access array element that does not exists.
And another one is when you actually just run out of memory. Have you profiled your project how much memory it uses on WebGL and PC? Maybe you set too little starting memory on build settings (idk if those options are on 2022 or only starts from 2023).

You say it fails on reload. Does it fail on load even if full refresh with disabled cache ? Do you cache anything or read anyting from cache?

woeful matrix
astral wave
#

or you somehow store more than 1 mb of data. Like try storing images or something.

woeful matrix
astral wave
#

Maybe old cache was playing with your new build. I guess.. Yey?....

woeful matrix
#

yeah maybe..two of the entries got removed, when i reloaded. before there were 4 entries in the cache storage, now there are just 2. Glad that it worked. Thanks!

amber ginkgo
#

I'm not very familiar with ServiceWorker but make no mistake Unity's caching is done internally not through serviceWorker or other standard solutions

amber ginkgo
#

https://stackoverflow.com/questions/79246791/ios-browsers-reload-webgl-games-built-with-unity-on-big-loading-events-that-do
I had fixed the issue for iPhone 14 pro by removing all CancellationToken from the game and giving breaks for loadings. Now it's appearing on iPhone 14 pro max
Any idea?
game url
-# cc-entry-secret

astral wave
#

what do you mean giving breaks or loading/

amber ginkgo
spare smelt
#

hi im new!

verbal estuary
#

Finished my first Unity project! Play the game on your desktop browser and leave any notes for me

#

One thing I find weird is that there is supposed to be text on the top left keeping track of your score. It's not on the web version, but on the computer version

solar hound
#

Hi, how do I open another Android app or iOS app from Unity WebGL??

astral wave
cunning radish
strange grove
#

how do i get if app is in background or out of focus for webgl on native devices?

astral wave
# strange grove how do i get if app is in background or out of focus for webgl on native devices...

once again, use JS and send message to unity;

document.addEventListener("visibilitychange", function () {
        if (document.hidden) {
            // App is in the background or tab is inactive
            SendMessage("GameManager", "OnAppBackground", "background");
        } else {
            // App is in the foreground or tab is active
            SendMessage("GameManager", "OnAppBackground", "foreground");
        }
    });

    window.addEventListener("blur", function () {
        SendMessage("GameManager", "OnAppFocus", "lost");
    });

    window.addEventListener("focus", function () {
        SendMessage("GameManager", "OnAppFocus", "gained");
    });

Examples

strange grove
#

I did try this it didnt work for me. My webgl game is hosted on discord as a discord activity

astral wave
#

Sorry I am not familiar with discord API and how its handles events like these.

strange grove
#

No problem thanks.

brave cipher
#

Hey guys, I've been struggling with this for a while, and I don't know where to ask. So i've made a chatgpt wrapper using unity and tried to export it to WebGl, but I keep getting a webassembly error. I'm pretty sure I can find another way to do the wrapper. I'm just wondering what went wrong and why it's broken, anyways it works fine and is able to be build in Windows.

sweet oriole
brave cipher
#

Ahhh, yea I just use a .net libary for it ;-;

#

im guessing it's a CORS thing?

sweet oriole
brave cipher
#

huh

sweet oriole
brave cipher
#

ok, yea I'm pretty sure that's the issue as I'm looking into the lib

#

thank you

restive mica
#

hey guys, I'm working on a project as a complete beginner. I'm trying to build a webAR service for which I'm facing a lot of issues in XR plugins and to integrate AR part in the unity
can someone personally connect over and guide me with the same, it would be really helpful for me. thanks in advance!

frigid root
#

My project uses webGL 2.0 and photon PUN2
I have performance issues (~25fps or so) so i'm trying to enable multithreading however i'm getting these issues when i start trying to connect to the photon server.
Any ideas why this is happening, thanks in advance? Unless I'm just dumb in thining that turning on multithreading will magically fix performance issues. I also tried webGPU but that gave no significant increase in performance

limber lily
#

excuse me guys, does anyone ever had problems on UI buttons lagging or input lagging from webgl build?

#

my game runs smoothly but the UI inputs kinda lag escpecially when pressing TMP buttons

astral wave
astral wave
limber lily
#

I have a mobile controller using the new input manager system, the reaction time whenever the user pushes a button or move swipe the screen is slow

#

There's a significant delay

#

How do i profile in mobile browser's?

astral wave
# limber lily How do i profile in mobile browser's?

Depends on your unity version. But normally in build settings you choose developer build, then there will be extra option stating: autoconnect profiler.

then press build and run. Then you will see all logs on editor from your webgl, and can use all other debuging tools.

astral wave
limber lily
lunar ibex
#

Any hope to find clues why WebGL on a specific Android device just gives you black screen if you touch it?
More modern Andoids seems to be fine...
Doesn't have to be a button, just any place on a screen
Before that point, max 60 fps and everything is ok
I have heard that specific mobile game issues are basically discarded cause it's too annoying and specific to get to the root, sadly...
And it's getting even worse if we start talking about browsers and WebGL I guess

astral wave
# lunar ibex Any hope to find clues why WebGL on a specific Android device just gives you bla...

it sounds indeed like something difficult to solve. Especially as new devices seems fine. Most commonly the issues with different devices comes to:
A) less resources, for example not enough RAM.
B) Racing conditions. On fast device task A always completes before task B, but on slow devices that can be different.
C) hardware incapability.

First of all, when you open browser console, do you see any errors and warnings? You can connect your android to PC and have for example chrome console connect to your device and see logs in real time.
Second, have you tried building in develop mode and see if there is any differences?
Third I would suggest connect profiler and see more precisely, but on android it will be harder. So instead try running memory profiler on your webgl version on pc, and tell me the how much memory does your game eats.

Last one is a long shot, is your background is black maybe by default? As there are some instances when touch on webgl returns values that is very unexpected. For example you epect values between -1 and 1 yet webgl returns you 124 or -800 or something. That can cause errors in your code or send camera really really far away somewhere and it just looks black. I suggest have FPS meter always running to see if game froze it self.

Seeya Later I hope that will give you clues to this weird problem.

plain willow
#

While i m building WebGL the site opening but the game is not, it is being white screen and console writes me "saving has no effect. your class 'unityeditor.webgl.httpservereditorwrapper' is missing the filepathattribute. use this attribute to specify where to save your scriptablesingleton. only call save() and use this attribute if you want your state to survive between sessions of unity. unityeditor.buildplayerwindow:buildplayerandrun ()" i m searching this everywhere but couldn't solve it

brittle cargo
plain willow
#

I tried for windows and dont have any problem with it

#

Should i go for Android?

#

Actually i m new for unity and this project came to me , i didnt make this and i m trying to solve this problem cause i need to make this project WebGL

brittle cargo
plain willow
#

Normally i m making games in different editor

plain willow
#

Btw they sent me with api , api and project folder

plain willow
brittle cargo
plain willow
#

http requests

#

this is the screen i get in site

#

this is the error i get

#

and still couldnt solve it

brittle cargo
#

Oh interesting what is this ScriptableSingleton

plain willow
#

Wish i could know

#

I searched every folder

brittle cargo
#

You have the project

plain willow
#

Every cs every script

#

But couldn't find it

brittle cargo
#

How did you search through scripts

#

IDE?

plain willow
#

Visual studio?

brittle cargo
#

Ah fine

#

Interesting

plain willow
#

And i tried to change unity version as well

#

But same error always

#

and the other error this as well so i m completly stuck

#

but exe is working ๐Ÿ˜‚

#

so how can i solve this , anyone ?

brittle cargo
# plain willow

is there any reference to this getInternalformatParameter in the code?

#

also what are your webgl build settings

#

how are you serving it

plain willow
brittle cargo
plain willow
#

yes so here is the thing

#

oh and i tried itchio as well

#

not working ๐Ÿ˜‚

brittle cargo
#

ahhh ok ok

#

interesting

#

ahhh lol this will work in firefox tho

plain willow
#

should i open this in firefox html ? or building ?

brittle cargo
brittle cargo
plain willow
#

let me try

brittle cargo
#

does firefox open the webgl?

plain willow
#

yep it did

brittle cargo
#

does it work?

#

like, the game itself

#

(it should if SSL is handled correctly)

plain willow
#

trying rn

#

nope still not working

brittle cargo
#

what part?

plain willow
plain willow
brittle cargo
plain willow
#

but videocard is not the problem

#

i tried in 4060 ti as well

#

same error

brittle cargo
#

yeah 1050 has driver level webgl support

#

very interesting

plain willow
#

and the funny thing is when i create blank project

#

it works and openฤฑng

brittle cargo
#

well of course

plain willow
#

but this project has problem and i cant find it

#

this is the project btw ๐Ÿ˜‚

brittle cargo
plain willow
#

this is build

brittle cargo
#

most of it is editor cache

#

i have a small 2D game which at one point had a 20GB project folder

plain willow
brittle cargo
#

nah that wouldn't help

plain willow
#

and i tried delete library and re opened

#

didnt work as well

brittle cargo
#

nah those kinds of fixes are for extremely specific problems

plain willow
#

i just wonder

#

is this normal

#

this much folder ?

brittle cargo
#

in the webgl build?

plain willow
#

cause when i see in videos there are less then this

#

yes

#

this is webgl build

brittle cargo
plain willow
#

yes something exactly wrong with me building settings

#

let me send you wait

brittle cargo
#

but my project is literally just empty scenes with code generating UI for each scene

plain willow
#

oh

#

well still i didnt change any building setting

#

can you help me if it is okay

#

this is default i guess

brittle cargo
plain willow
#

tried it

brittle cargo
#

i couldn't get either brotli or gzip to work for the life of me

plain willow
#

๐Ÿ˜‚ but let me try again

brittle cargo
#

but it usually shows if that is the problem

plain willow
#

before try that should i delete the one i builded

brittle cargo
#

you can but it should overwrite

plain willow
#

so it can work if it is on build ?

brittle cargo
#

wdym

plain willow
#

or should i build in different folder

brittle cargo
brittle cargo
#

unless you want to keep the old build

plain willow
#

should i change here ?

brittle cargo
#

you can try development build

#

to see if it changes anything (unlikely but worth a try?)

plain willow
#

yep why not

#

btw what if project connects to api ?

brittle cargo
#

then it connects to api

#

no problem

#

development builds usually build quickly and run poorly because they donh't implement various optimizations under the hood

plain willow
#

cause i didnt

#

cause i dont know how to connect api and unity :d

brittle cargo
#

think of unity as a frontend application

#

for example

        {
            _messageLabel.text = "Logging in...";

            var url = $"{Globals.AuthServer}/api/auth/login";

            var loginRequest = new LoginRequest
            {
                username = username,
                password = password
            };

            var jsonData = JsonUtility.ToJson(loginRequest);

            var request = HttpClient.CreatePost(url, jsonData);
            request.downloadHandler = new DownloadHandlerBuffer();
            request.SetRequestHeader("Content-Type", "application/json");

            yield return request.SendWebRequest();

            if (request.result is UnityWebRequest.Result.ConnectionError or UnityWebRequest.Result.ProtocolError)
            {
                _messageLabel.text = "Error: " + request.result + "\n" + request.error;
                if (!request.error.Contains("404")) yield break;
                _showRegistration = true;
                Generate();
            }
            else
            {
                var loginResponse = JsonUtility.FromJson<LoginResponse>(request.downloadHandler.text);

                if (!string.IsNullOrEmpty(loginResponse.token))
                {
                    PlayerPrefs.SetString(Globals.AuthTokenColumn, loginResponse.token);
                    PlayerPrefs.Save();
                    _messageLabel.text = "Login successful!";
                    StartCoroutine(FetchUserInfo());
                }
                else
                {
                    _messageLabel.text = "Login failed: Invalid credentials.";
                }
            }
        }

I have this login method, it simply calls my Auth API

#

i have this httpclient wrapper for unitywebrequests to add auth token to each of my api calls:

            string method = UnityWebRequest.kHttpVerbGET)
        {
            var request = new UnityWebRequest(url, method)
            {
                downloadHandler = new DownloadHandlerBuffer(),
            };
            var authToken = PlayerPrefs.GetString(Globals.AuthTokenColumn);
            if (!string.IsNullOrEmpty(authToken))
            {
                request.SetRequestHeader("Authorization", "Bearer " + authToken);
            }

            return request;
        }

        public static UnityWebRequest CreatePost(string url, string jsonData)
        {
            var request = Create(url, UnityWebRequest.kHttpVerbPOST);
            var bodyRaw = System.Text.Encoding.UTF8.GetBytes(jsonData);
            request.uploadHandler = new UploadHandlerRaw(bodyRaw);
            request.SetRequestHeader("Content-Type", "application/json");
            return request;
        }
#

so it's really all in the code

plain willow
#

so i can write that as well but how

#

are you free if i share you screen

brittle cargo
#

it should already exist in the code of your unity project

#

if it has any form of api integration

#

search for new UnityWebRequest

plain willow
#

well i did but that api i couldnt make that work

brittle cargo
#

why not

#

and what did you try?

#

how would you test an API?

plain willow
#

well i opened api in visual studio

#

and started .d

#

and then i tried to add to unity project

#

i did but still couldnt connect it

#

api there but

#

i wonder if it is working .d

brittle cargo
#

no you don't need to add the api project to the unity solution

#

the api is a separate application

#

running on some server

plain willow
#

yes i tried that as well

brittle cargo
#

you have both the unity project and the api of the game?

#

so basically the entire source code?

plain willow
#

yes

#

entire source code on my hand but i couldnt build for webgl .d

#

funny right ๐Ÿ˜‚

brittle cargo
#

i mean

#

how long have you worked with unity

#

and how long have you worked with webdev

plain willow
#

3 days for unity 1 day for web dev ๐Ÿ˜‚ but 4 years for ue

#

but i need to make this happen i have no other way

#

and i have 3 days so i searched everywhere over internet

brittle cargo
#

probably nothing in ue you did had anything to do with online integration

brittle cargo
#

don't be so hard on yourself

#

you are basically a junior for this stuff even if you have good logic crunching skill from ue

#

alright so your task is to make a unity project work on webgl yes?

plain willow
#

yes

brittle cargo
#

so what you need is a build that functions in webgl just as it would in say android or windows builds

plain willow
#

yes exactly

brittle cargo
#

can you do a clean pull of the unity project?

#

so just clean from repo

plain willow
#

i m doing actually

brittle cargo
#

ok you know git, good

plain willow
#

so will be 2 different folder

#

1 will be game and one will be for api

#

right ?

astral wave
#

I agree on that, WebGL is nasty beast. It have a lot of caviats that dont work on it.

I would suggest you to start debuging step by step. First create new scene and include only new scene in a abuild. it can be emty scene. Build and run, see if that runs. This would show if your project settings or template is incorrect. After that you can work with searching other things.

plain willow
#

i will not mix them

brittle cargo
#

do not mix them

#

also you don't need the api for this step

#

you just won't be able to log in or whatever

#

we'll worry about that later

plain willow
#

okay

brittle cargo
#

But yeah webgl is %#]!ยฅ<

plain willow
#

but this project doesnt

brittle cargo
#

Create a new scene in this broken project

#

And in build settings enable only that new scene

plain willow
plain willow
#

should i delete the main scene in build settings??

#

or just disable?

brittle cargo
#

Disable for now

plain willow
#

okay

brittle cargo
#

All of em except the new one

plain willow
#

well there is only one already so np

#

i will just disable that

brittle cargo
#

Only one scene?

plain willow
#

yess one scene but many things

brittle cargo
#

i guess that's doable

#

hmm, that gives me an idea to remake my project to be single scene

#

i already generate ui purely via code

plain willow
#

๐Ÿ˜‚

brittle cargo
#

nah I mean this would be kinda like a single page application

plain willow
#

btw should i connect project to cloud ?

brittle cargo
#

i've never done that

#

git is my cloud

plain willow
#

well i event tried that as well

#

i opened git cloud in vs and didnt work as well ๐Ÿ˜‚

#

waiting still

#

it wil open in 5 min

#

Well i liked unity after if we can solve this i will start learning unity from bottom

#

New challanges needed

astral wave
# plain willow yes so here is the thing

for this you need to run build and run. Rather than opening index html. At least in chrome. you need to disable some flags in order to load it otherwise. I think same goes for firefox, you need change settings to support it.

brittle cargo
#

yeah tbh i had a bunch of settings changed in firefox so mine isn't the default

brittle cargo
#

and that was long enough ago i don't remember any of that

plain willow
#

i tried everything over internet

#

before ask anyone

#

here is my last hope

astral wave
#

I jsut trying to catch up and adding some extra info. Also you might want to try building developer version and connect profiler to it, so you could see more precise which code causes the problem, if it that is the code problem.

plain willow
#

i tried different build settings etc.

astral wave
#

You said it uses API and was build not as webgl target platform. Are you sure there is not websockets code or other WebGL not supported code? Or multithreading like Jobs and etc. DOn't mind I am just firing blindly while waiting for emty scene build results ๐Ÿ˜„

plain willow
#

๐Ÿค”

astral wave
#

So next thing you can try after testing emty scene. Disable some game objects that have features you can modulary disable. Try if that works on editor. Then build it. And then enable one by one and see where it will break. That will take tons of time, so make sure to build in developer mode to make it faster.

brittle cargo
#

i need to quickly implement something with websockets

plain willow
#

so should i say yes to this

astral wave
astral wave
# plain willow

oh you have adressables in your project.... you know how to use them riiiight?

brittle cargo
#

I already use UnityWebRequests for https

plain willow
#

ofc not ๐Ÿ˜‚

#

how can i know

brittle cargo
#

got this set up, very comfy

#

seems to work fine on both webgl and android

astral wave
#

so in short. Adressables makes your game assets in to packages. sort of. So everytime you change something, depending on your settings, you need to rebuild addressables before building game project it self, otherwise changes will not be there. so make sure to build addressables before building project.

astral wave
plain willow
#

oh wait so before i build

#

i have to build adressables ?

astral wave
plain willow
#

well i didnt change anything except adding new scene ๐Ÿ˜‚

plain willow
#

i see i just checked how to build addressables i didnt try that , maybe before i build i should build addressables

brittle cargo
#

ahhh it's a non default package

plain willow
#

okay i builded addressables

#

and now building new scene lets see

#

what will happen

#

maybe i should have gone with main scene

#

๐Ÿค”

#

it is like this btw ๐Ÿค”

brittle cargo
#

idk anything about this ๐Ÿ’€

plain willow
#

everything in here ๐Ÿ˜‚ yes the problem is this

#

i m pretty sure problem is this one

#

but lets see

astral wave
#

what is in Build In Data. As here it seems only localisation, which should not effect anything too much.

plain willow
#

well all game in here actually

#

localization , what is that ? is it different thing ?

brittle cargo
astral wave
#

localisation mean it will choose different code, mostly text for different locations. Like in tukey it will be turkish, in spain spanish and etc.

plain willow
#

ohhh than this is not problem

#

this is just language

brittle cargo
#

localization assets are usually just a bunch of strings in different languages

plain willow
#

๐Ÿฅฒ

#

almost done building

#

lets see

brittle cargo
#

webgl builds are slow as hell

#

i need 16 cores ๐Ÿ˜ฆ

plain willow
plain willow
brittle cargo
#

damn

plain willow
#

now 3 more min

brittle cargo
#

what cpu

plain willow
#

i7 7700 ๐Ÿ˜‚

brittle cargo
#

damn

plain willow
#

7 years old

#

he is bigger than most children ๐Ÿ˜‚

brittle cargo
#

man it's almost 8

plain willow
#

but still working ue5

#

alright new scene is working

#

and error is still here btw ๐Ÿ˜‚

astral wave
#

good. Time to disable everything and build alot of times enable thigns one by one. Dont forget to build as developer mode o make it faster. and change build type for build speed

plain willow
#

oh

#

okay

brittle cargo
#

damn i ran a build for my project with shorter build time

#

took a bit under 1min 30s

#

but remember my project is literally just six scenes like this

plain willow
#

which one i will selecet?

#

hand or eye?

brittle cargo
#

it's in its early stages and i have to set up a lot of ui

#

a bit under 1200 lines of cs code

plain willow
#

Optimized

brittle cargo
#

early

#

no gameplay ui done yet

astral wave
brittle cargo
plain willow
brittle cargo
#

check out my helper methods

astral wave
brittle cargo
#

(yes, I know I can use uss, I use it too)

plain willow
#

well you said disable it

#

i dont know how to disable ๐Ÿ˜‚

#

is it same in ue

brittle cargo
#

had a few good days with it

astral wave
plain willow
#

oh shoot

astral wave
#

unchecking it will disable it.

plain willow
#

okay it is easier

brittle cargo
#

i'm now at the point where i can write ui elements (like for example a slider + text) from start to finish without once checking how it looks and it comes out exactly as i wanted it

#

definitely not at any advanced level where i can make crazy geometry with uss

#

I really like UI toolkit because of how easy stuff like this is

#

my game will be very heavily based around UI for interaction so I'm pretty pumped having finally somewhat grasped it

#

ngl it was tough at first because I tried to do with via the ui builder rather than code first/code only

#

it was such a pain fiddling around with the ui builder

plain willow
#

okay started to disable everything

#

lets see if it works

#

that means while everything disable it works right ?

#

๐Ÿ˜‚

astral wave
#

thats good news. now you just enable one by one and see where it stips working ๐Ÿ™‚

plain willow
#

finally something happenniingg !!

brittle cargo
#

niiiiiiiiiiicce

#

easy

#

so it was just addressables huh

#

i can totally believe that

plain willow
#

i guess i found the problem

#

but this one is funny

#

๐Ÿ˜‚

brittle cargo
#

very typical

plain willow
#

everythin enable except 1 thing

#

and working

#

๐Ÿ˜‚

#

windmill

#

the model

#

this one how can be possible

brittle cargo
#

did you redo the addressables build

plain willow
#

i didnt do anything with it actully

#

should i search this mindmill in vs ?

astral wave
#

welcome to webgl. when you do nothing and it works, and when you do nothing and it doesnt work ๐Ÿ˜„

plain willow
#

๐Ÿ˜‚ you are welcome

astral wave
#

first try running it with it enabled to be 100% sure it is its problem

plain willow
#

well how can i solve that

#

there are 3 lod here

#

probably problem is here

#

lets see

#

trying without it

#

then there is no problem with code

#

the problem was lightning always

#

so the problem is exact this one how can i solve this

#

i cant believe that was the problem all the time

#

so okay we solved this but how can i connect api

#

there are requests

#

but i think thats enough for today i will research for that

#

still thank you so much guys both of you

#

๐Ÿ™

astral wave
#

API connection is literally just UnityWebRequests POST and GET requests. Just as our friend showed before ๐Ÿ™‚ you might need to work with CORS settings and etc, but that is for laters.

plain willow
#

well i dont have much time actually

#

and there are codes already written and ready

#

i just dont know how to activate api ๐Ÿ˜‚

#

cause as i said it was working in exe

#

so it has to be connected right ?

astral wave
# plain willow so it has to be connected right ?

it depends on how you API is created. And how you connect. Some API establishes connection and keeps it. others just sends information when needed. I can't answer this question for you without seeing code.

plain willow
#

It is sending information when needed

astral wave
#

have you confirmed it sends data with logs? does error handling states that anything goes bad? No logs? Are you using unity web requests?

plain willow
#

this is my api opened one @astral wave

#

i thought this means sending information

#

and login not working