#🌐┃web

1 messages · Page 2 of 1

cunning shell
#

But it does help with in game fps?

charred briar
#

Probably not, it would load them all, and trigger their colliders to do a physics check. My experience is that collision check is actually way more of a performance hit than anythibg.

It will definitely improve the FPS in most cases though

#

Technically it would probably have a very small speed up when the scene goes live. But like 10ms at most kind of thing

cunning shell
charred briar
astral wave
#

it will help in 90% of cases. As long you camera moves and you have something that you dont need to see, it is a a performance boost. Expecially with terrain or indoor enviroments.

#

it make your project just a bit bigger tho 😄

halcyon pier
#

does anyone know why unity 2021 seems to have so many issues when pushing webGL. I have some UI that got so sluggish when I introduced a new model in the scene, this model is way less complex then the one it replaced but somehow the UI framerate dropped in half! I tried to rule out the model by even stripping it down to nothing but a little part of the model thats like 100 verts and with a mobile shader. Finally I put it in unity 2019 and its fine

#

what am i doing wrong? is 2021 just shit

#

2022 same issue by the way

dusk vigil
#

How do I play a video in a UnityPlay WebGL build?

#
videoPanel.GetComponentInChildren<VideoPlayer>().url = "test.mp4";
videoPanel.GetComponentInChildren<VideoPlayer>().Play();
#

I am using this in code to get the video. It works when I play it in the editor but not when its up on UnityPlay

#

I am hosting the video in github pages

#

Is there something special I should be doing?

#

*also the "test.mp4" is not the real "https...test.mp4" url I am using

silk brook
#

ok now what is the best lighting approach for webgl,
it's completely different than what it looks on the editor

silk brook
halcyon pier
halcyon pier
#

oddly enough even chrome on a pc is. fine

silk brook
#

I felt way more insecure about it from day one and further T_T
anyway please drop me some tutorial for webgl lighting @halcyon pier

astral wave
astral wave
#

and put it in your streamign assets. that is simpliest way. otherwise you will have tons of funsies 😄

silk brook
#

anyway do you know how to make WebGL lighting appears like lighting at editor

#

do we need bake them first ?

#

tutorial link please

astral wave
#

have fun reading it 🙂

#

It depends on your pipeline, and if lights are real time or baked or mixed.

#

Have in mind HDRP will not work on WebGL and you cannot make it in same way ever ever ever.

astral wave
silk brook
#

e.g there is shadows appear on my editor, but once I build it to WebGL,
realtime shadow didn't appear at all

astral wave
#

most likely becayse on webgl and editor default quality settings are not the same

#

this is mine, so it is all the same. but by default, pc is higher options and etc.

cunning shell
#

What is the downside of using data caching in unity webgl?

astral wave
#

If you will update your build people who downloaded it once before might not see differences. Offcourse that depends on your webserver setup as well.

cunning shell
#

Okk thankss

wet fog
#

hi, has anyone had problems with shaders on webgl?

#

I have few objects on shaders

#

when built its not visible 🙂

wanton jetty
#

Hello

#

can use Probuilder of Unity for my commercial project?

#

im confused... please Help me out...

astral wave
#

yes you can use probuilder for commercial project. As it just lets you build 3D models.... It is same as using blender on any other asset. As long as you are selling it as a game and not a tool

wet fog
#

oh also, does additive materails / shaders etc work in webgl?

astral wave
wet fog
#

Thanks you for answer, its a shame it does not work too good 😄

wanton jetty
#

well...Probuilder of unity has some third party licences notice.....

#

here it is

#

thats why i was confused...

#

if i can use Probuilder of unity for my commercial project or not.

#

please take some times...and just answer me 🙏

keen urchin
wanton jetty
#

well, Im just using the ProBuilder tool , not selling this tool itself ...so ,in that case , I can use that ProBuilder of unity in my commercial project , isnt it?

keen urchin
wanton jetty
#

all the license types are MIT except one ...which is 3- Clause BSD

#

so, in that case ...do i have to attach those licenses in my release to obey the terms and conditions?

keen urchin
wanton jetty
#

if my release only just includes gameobjects or something modified by ProBuilder ...then do i need to attach those notices?

sweet oriole
keen urchin
austere tiger
#

directly, can't find decent tutorial tho

austere tiger
#

Y'all
Can anyone tell me more about this ?
Downloading some files is required on my WebGL game
wether it's a pdf or image

#

A tutorial would be helpful

worthy ruin
#

Any gurus around can give me a hand

#

got the following jslib function

#

defined my method like this on the C# side

#

fails to compile

#

how is the signature not matching?

#

I am extremely confused here

#

if I remove the extension parameter it does work

#

why is the compiler giving me bs for adding a new parameter to the function?

#

like, for reals, wasm is saying this is the line with error

#

    public void UploadMIDIFile()
    {
                UploadFile(gameObject.name, "ParseMidi", ".mid");
    }

#

    [DllImport("__Internal")]
    private static extern void UploadFile(string gameObjectName, string methodName, string fileExtension);
    

#

var UploadFilePlugin = {
  UploadFile: function(gameObjectName, methodName, fileExtension) {
    var gameObject = UTF8ToString(gameObjectName);
    var method = UTF8ToString(methodName);
    var fileExt = UTF8ToString(fileExtension);
    var unitycanvas = document.getElementById('unity-canvas');
    
    if(!document.getElementById('UploadFileInput'))
    {
      var fileInput = document.createElement('input');
      fileInput.setAttribute('type', 'file');
      fileInput.setAttribute('id', 'UploadFileInput');
      fileInput.setAttribute('accept', fileExt);
      fileInput.style.visibility = 'hidden';
      fileInput.style.display = 'none';
      fileInput.onclick = function (event)
      {
        this.value = null;
        //make sure all listener are removed even if you cancel the dialog
        var element = document.getElementById('UploadFileInput');
        element.parentNode.removeChild(element);
      };
      fileInput.onchange = function (event)
      {
        if(event.target.value != null){
          SendMessage(gameObject, method, URL.createObjectURL(event.target.files[0]));
        }
      };
      document.body.appendChild(fileInput);
      fileInput.setAttribute('class', 'focused');
      fileInput.click();
      fileInput.setAttribute('class', 'nonfocused');
    }

  }
};
mergeInto(LibraryManager.library, UploadFilePlugin);

#

Dealing with this JS non sense is taking away years of my life

#

lmao

#

I was in fact, correct, the signatures do match, but Unity being terrible once again for some reason has the file cached somewhere

#

fixed it by making it a new function with a different name

#

thanks Unity, love you

fast cloud
#

Been trying to figure out for a while now how to get player prefs to transfer between updates

#

I know the data still exists somewhere but I can’t figure out how to access it from the new updated build

#

Found this a bit ago, but can’t seem to get it to work

sweet oriole
fast cloud
#

Damn, I wonder if someone has made a unity package to do that yet

sweet oriole
#

Well Unity ships with multiple serializers and regular file IO works

#

Newer versions have newtonsoft JSON, but original JsonUtility can also be used

fast cloud
#

I’ll try and search around for a premade solution, most of this conversation is going over my head 😅

sweet oriole
#

Most game saving tutorials that don't use player prefs go over these things

#

Instead of one of the JSON serializers, you might see BinaryFormatter instead.

fast cloud
#

@sweet oriole I found a tutorial and followed it

#

I tried using System.IO.File

#

it worked in the editor but it doesn't work in webgl

#

Like, it doesn't even save between sessions of the same build

sweet oriole
#

For this you need to make sure you do the filesystem JS sync thing

fast cloud
#

So just add

    [DllImport("__Internal")]
    private static extern void JS_FileSystem_Sync();

To my script, and call it on start?

sweet oriole
#

Call it whenever you have written to the filesystem

#

Worth noting that your snippet I believe relies on Unity already shipping that JS method, which may or may not be present or called the same in your Unity version, but it's worth a shot. If you see related errors later, you can just include a certain JS script into your project to address it

fast cloud
sweet oriole
#

You shouldn't need to.

sweet oriole
fast cloud
#

@sweet oriole Works inbetween sessions now, but not inbetween builds

sweet oriole
fast cloud
#

var fullPath = Path.Combine(Application.persistentDataPath, a_FileName);

#

Not code I wrote myself, but I think that's the path

sweet oriole
#

You are probably going find a pretty random looking string of numbers and letters in it, which you should be able to replace with something prettier if you want.

fast cloud
#

Just do Debug.Log(Application.persistentDataPath);?

sweet oriole
#

Yea

fast cloud
#

Ok, so it was /idbfs/034ce56c07271c4f51364fd8d201959a

#

And I did fullPath = Path.Combine("/idbfs/DeckBuilder", a_FileName);

#

It's building now, so i guess we'll find out if it worked

fast cloud
sweet oriole
#

Anything in browser console?

fast cloud
#

I couldn't get the browser console working

#

I ended up making the path display on the screen

#

Wait, do I just use inspect element

#

Whoops

sweet oriole
#

Yea talking about the browser console 😄

fast cloud
#
Failed to read from /idbfs/DeckBuilder/SaveData.dat with exception System.IO.DirectoryNotFoundException: Could not find a part of the path "/idbfs/DeckBuilder/SaveData.dat".
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00000] in <00000000000000000000000000000000>:0 
#
Failed to write to /idbfs/DeckBuilder/SaveData.dat with exception System.IO.DirectoryNotFoundException: Could not find a part of the path "/idbfs/DeckBuilder/SaveData.dat".
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00000] in <00000000000000000000000000000000>:0 
sweet oriole
#

How are you writing/reading it? Might need to make sure you are doing it in a mode that handles part of the directory being missing

fast cloud
#
    public static bool WriteToFile(string a_FileName, string a_FileContents)
    {
        string fullPath = FullPath(a_FileName);

        try
        {
            File.WriteAllText(fullPath, a_FileContents);
            return true;
        }
        catch (Exception e)
        {
            Debug.LogError($"Failed to write to {fullPath} with exception {e}");
            return false;
        }
    }
#

I guess I need to create the /idbfs/DeckBuilder folder first?

sweet oriole
#

Most likely. Pretty sure there are methods in System.IO that should handle this for you, but I can't recall them

fast cloud
#

In WebGL the path is passed through md5, that's why you can't recognize your directory name.

#

Found a fourm that mentioned this ^

sweet oriole
#

Can you link it?

fast cloud
#

They use Directory.CreateDirectory("idbfs/abcdef");, but it didn't work for them

sweet oriole
#

The md5 commend seems to just refer to why Application.persistentDataPath looks weird

#

WebGL: Application.persistentDataPath points to /idbfs/<md5 hash of data path> where the data path is the URL stripped of everything including and after the last '/' before any '?' components.

#

Try doing the Directory.CreateDirectory and writing to it to see what happens

fast cloud
#

It also works between builds now :)

#

Thanks a lot for your help!

agile sigil
#

I need help plz

#

I'm using the new input system. My controller works just fine in the Unity editor, also if I export my game to desktop. But when I export my game to webGL the right thumb stick doesn't move vertically at all.
It's just that one axis, horizontally it still works.
I've tried everything I can think of, searched the entire internet and found nothing.

whole loom
#

Hi, can I differentiate between Touch and Mouse on WegGL Builds? Even use multitouch?

#

And for control on Computer with mouse it shouldn't be needed to hold down the mousebutton. But on touch devices this would make it possible to jump between position, which is already possible when using multiple fingers - as it gets the average then.
So it would need real multitouch detection and follow just one finger - and also it would be possible to have 2 players on 1 device then

hexed ridge
#

anyone know how to fix this

arctic rose
cosmic canyon
#

Hi guys just want to ask about webgl build, so I created a webgl game and everything is fine when I'm using a web browser in a computer, but when I use a mobile browser everything is ruined since it's running in portrait mode, is there a way to make it force run in landscape mode when playing in a mobile web browser?

astral wave
astral wave
#

you can easily Rotate automatically screen if game mode is full screen. yet to make it full screen you need user to click on screen at least once. Otherwise due security reasons you wont be able to make it 😄

cosmic canyon
astral wave
#

you will need to write your own. Mostly Javascript to go full screen in browser mode. And then trigger event on unity to rotate or something like that. If you will google this question you will find 3 common solutions. But all of them will include needing Javascript or html5 manifest editing.

cosmic canyon
#

But the fullscreen will fix the orientation of the button and objects since it doesnt scale with the screen right now

hollow girder
#

is it possible to use 2 on-screen joysticks in webgl mobile?

#

by default it looks like one of the joysticks is stuck when other is in use

#

same applies to the buttons

hollow girder
#

i wonder if there is a bug report for that issue or not

warm quartz
ancient dirge
#

i am uploading my Project on GitHub and my Build is continuously failing can someone help me with that?

crisp drum
#

Hi everyone, i have a serious and very problematic question: I 'm currently working on a webgl project and, i don't know why, since this afternoon my build passed from 550 sec to 90 sec to be built with no error . BUT since the build crashes when put on the server with : Invoking error handler due to
RuntimeError: index out of bounds / Uncaught (in promise) RuntimeError: index out of bounds.
Does anyone has an idea or some direction to give?

astral wave
astral wave
# crisp drum Hi everyone, i have a serious and very problematic question: I 'm currently work...

Well, first of all I would check you Build scenes list, if all of them are there. As super reduced time in building could mean not all assets are being loaded. Aka you will get null reference when your base scene tries to load something.

Correct way to check would build in Developer mode and add full stack trace of logs, so you would see which script gives you index out of bound.

Clearing old build files and Choose BuildClean might also help. For quicker check you can try Build and run to check if it works locally without server (on this option unity creates temp server for u)

astral wave
crisp drum
#

@astral wave THank you very much for yours advices !!
In fact i have only one scene in my build. I tried to rebuild several time ( i also restart everythings) but no sucess. I switched back to PC, then restart; and then switched back to webgl. The only thing that happened in the middle of this afternoon was that i losted intellisense in Visual studio and i got a message saying mostly " you don't have the visual studio tools in use and you need to change the external tool in unity...) It was very weird.
I will try a full stack trace and see what is logging.
Thank you. once i found the problem i will share my solution ( if i have one)

astral wave
#

that normally fixes 90 % of problems

hollow girder
crisp drum
#

@astral wave Thanks ! It is one of my ideas to see what' going on, but in the past when i used it sometimes the project was totally destroyed ( lost reference to asset database....) So it' in the last resort for me.

crisp drum
#

Ok i 've found the problem. Some assignations was broken. ( Why? i don't know) And most of all, I did not receive any notification ( null reference exception.... ) Really weird. But it's working now. Thank you every one and thank you @astral wave 😉

jolly flare
#

gey guys, how do i get a skybox to not be distorted and glitching on my android phone?

#

i have been googling and messing with all sorts of settings for a few hours now, and cant get it to render properly

#

any idea what could be causing that weird distortion? ive tried several different skybox materials from the asset store and set them all to mobile/skybox and played with the settings

#

it only does it on mobile, when i play it on PC it doesnt do it ><

stone ravine
#

Hi, so I'm targeting WebGL for my game I'm making for my thesis in uni, I'd like it to be able to run in mobile browsers also especially on an ipad. I read somewhere on Unity's website that on v2022 they removed the warning for mob browsers on webGL build and also that they plan on supporting them in the future on their roadmap. My project is currently on v2021 stable and I'll probably hand it in in 2 months time. Do you think I'd get it running smoother (advantageous to switch to) if I tried v2022 or 2023?

astral wave
astral wave
jolly flare
#

Yeah it sucks. I hate working in webgl but it's what the client wants so 😦

astral wave
jolly flare
#

lol yeah. i just wish people wouldnt put so much emphasis on being able to play webgl games on mobile.

#

like, they work well enough on pc, but garbage on mobile ><

astral wave
#

i wouldnt dare to say they work good enough on PC either.....

stone ravine
#

bruh I'm here cause professor wanta the game to play on iOS also but not pay for applestore and apple dev etc 😂

#

and he told me that after I accepted my thesis

astral wave
#

ufffffffffffff

brazen prairie
#

hey guys, whats the best solution for Voice Chat in WebGL but also compatible with Windows and Android (Oculus Quest)
Its for a metaverse project that will run on those 3 platforms

#

does this work with android too? can i make an app with this that goes for android and webgl simultaneously?

zealous marlin
#

Hello, I have a problem with my webgl build, all the sound effect sound very off and weird. Is it something know about webgl ? I'm using unity 2022.1.18f1

brazen prairie
zealous marlin
#

I don't really understand what you mean, I have sound, it's just that the quality is really strange

#

my webgl build just doesn't sound like my windows/linux build

astral wave
#

If you want voice chat on multiple platforms, forget webgl to have same solution. As other platforms can handle sound and directional sound and etc without problem, WebGL cannot do that. What you will need to do is Create JS voice communication and somehow connect it to your other platform voice servers.

#

you could try this plugin, it tested and works. but soon you will see the limitations of Webgl.

zealous marlin
#

I found what was wrong but I have no idea how to fix this "properly". There is a issues with webgl build, when you play a sound, the first 0.1 second just don't play. It's why my sound were weird. A quick fix can be to just add 0.1 second of no sound before the actual sound but I think unity have to fix this issues them self.

soft axle
#

I can't figure out how I actually run my webgl project. It just pops up with this wall of text.
Failed to download file Build/Builds.data.gz. Loading web pages via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host Unity content, or use the Unity Build and Run option.

#

I'm running it on firefox which is what the tutorial I'm following says works.

sweet oriole
astral wave
#

It is important to note, that build and run will run only once. if you will close it you cannot just open the build in your browser again. you need to build and run again 🙂

coral sedge
#

Hey, I dont know if this is the right place to ask but I just made a game and uploaded it to itch.io, my problem is that i have a build in leaderboard with playerprefs. This works fine for pc builds locally but on itch it does not really make sense since everyone can only see their own scores. Is there a way to make the leaderboard shared and somehow save the data on itch.io or some workaround that could make it work?
thanks in advance (:

arctic rose
#

You need a separate service for that. Firebase is a popular choice.

floral turtle
#

if i build my game for webgl and upload it to itch.io it doesnt run it only works if i select development build in the buildsettings does someone know why that is ?

#

i get this error

floral turtle
#

I found a solution

#

You habe to disable buil compression in the player settings

#

Thank you very much anyways

sweet oriole
#

On the other hand I'm not sure about Unity defaulting to suboptimal build settings because one of the most popular hosting sites has an suboptimal hosting configuration 😛

#

The visibility of this feedback will likely be quite similar if you make a thread on the forum and send a message through the roadmap page. Unity employee on the forum has assured that all roadmap messages are read.

#

The ideal solution would likely be for Itch.io to address this

charred briar
#

Mobile isn't supported for WebGL I believe, you may need to touch the screen to enable sound for some browsers. But not sure how well or stable mobile works. If interaction doesn't do it, it is likely a unitybug with webgl for mobile

stone ravine
#

did you find a fix for this?

high patrol
#

Unity is pushing to "officially" "support" mobile for webgl.

high patrol
#

Sometimes I feel like Unity intentionally half asses things so that they can leave it up to individual developers to fix their mistakes and put it up on the asset store--in which Unity takes a whopping 30% cut of all sales.

sweet oriole
high patrol
astral wave
charred briar
astral wave
keen urchin
#

WebGL has been slow to adopt important back-end features, Unity's hands have been pretty tied with it
It's quite a bit of work to develop an engine that has to run and have feature parity in all scenarios regardless of device or browser

last crystal
#

If I enable data caching and name files as hashes, does that mean I'll avoid issues with people having old data on new builds?

sweet oriole
last crystal
sweet oriole
#

The names change in the template for each build

last crystal
#

ah yes - that is part of my deployment process. Thank you!

ripe linden
#

hi there im having problem with WEBGL and addressables and caching, im since hours trying to fix it and all stuff i try so far dosnt seems to fix anything. in the player settings i disabled Data caching bool and still giving the error so its make me nuts.

the error its
Error while downloading Asset Bundle: CRC Mismatch. Provided 6b2caf2, calculated 477d6e31 from data. Will not load AssetBundle

i have try to parse the OperationException.message if contains the CRC mismatch for then call Caching.ClearCache();
but it results that you cant build webgl build with that line even if dont give error on visual studio, coz webgl now use other caching magic and there is no documentation on how to force to clear this cache...

any help please

indigo crest
#

what's the line of code to enable keyboard for input fields on android webgl?

charred briar
#

Or WebGLInput.mobileKeyboardSupport

indigo crest
#

thank you.

visual siren
#

Anyone here managed to load a glb file at runtime with the Khronos gltf plugin in a webgl build? We are getting no errors at all yet the model does not show up.

sweet oriole
visual siren
#

@sweet oriole No we are currently using the khronos one

#

I could try out a quick swap. Do you know if there is a ready to go API for loading a gltf model from a url at runtime ?

#

Looks like it and looks simple just add the component at runtime hahah

sweet oriole
visual siren
indigo crest
indigo crest
#

So, even if i bring up the keyboard manually, it still wont add the text to input fields. Any idea how to fix this, or is there a workaround?

astral wave
indigo crest
#

Thanks for the help, but i fixed it. Tmp was in version 3.0.6, but i needed 3.2.0 pre release for input fields to work.

novel flower
#

Hello peoples. When I publishj my game in webgl it lookes a little more zoomed in then it does when I test in unity. Any ideas to fix that?

knotty maple
#

Does anyone know of a guide/tutorial/code example/tool for exporting screenshots from a Unity WebGL game to Twitter?

There are tools on the store to handle this for iOS and Android, but nothing I could find for WebGL.

sweet oriole
astral wave
charred briar
#

Yup! And you can also pass the screenshot out of unity pretty easily as Base64. Which should share to email/twitter easily enough. Twitter did lock down their api so it is much less interesting now to work with

cosmic canyon
#

Can I use on screen keyboard in a webgl build?

astral wave
#

https://docs.unity3d.com/ScriptReference/Microphone-devices.html

I know that with microphones is pain in the ass.
So my guess is, becaus webgl dont have access to devices untill you interact with application, the initialization of default mic does not work for you. What you can do after first touch initialize devices list again and select the default version. This should work.

Tho I am pretty sure you using some kind of library right? as UNITY webgl does not really support microphone by itself. So there is something in Javascript side you can do.

astral wave
astral wave
#

sorry my head was not in correct place. But the logic is the same. Make a button which check and debugs all Audio devices. Check if after pressing button it actually finds it. If it does then all you need to select the needed device after your fist interaction with WebGL

#

In my project it load audio devices on mobile corectly, but as my audio manager is created bit later maybe that is the reason.

south socket
#

the resolution is weird for my webgl builds

#

thats what it looks like in game

#

but then when i build it

#

it looks like this

hollow girder
high patrol
#

The template is good to use since it kinda optimizes your Unity settings for smooth webgl builds

#

Also I use the Unity React component which you can set the resolution of the component in your html tag

#

er typescript

keen urchin
# south socket

For one if you preview the game window at a specific aspect ratio, that will not guarantee it'll look the same on a different resolution, even if the aspect ratio matches

high patrol
#

I think you should manually set it in Player Settings > Resolution and Presentation

#

Maybe try a static resolution too instead of an aspect ratio

south socket
sweet oriole
# south socket So how can I guarantee it

Developing in free aspect allows you to catch some of these issues earlier, as it's something you probably want to properly handle over locked resolutions or aspect ratios.

#

You can adjust the camera to fit as much of the gameplay area as possible and make sure there is some padding content around it to properly support various aspect ratios.

south socket
south socket
#

sorry i havent touched unity in a minute

#

last time i used it was like 2 years ago

astral wave
#

after your changes or before? 😄

#

I totally get you bro. I have similar problem with memory usage. My samsung 7 edge runs application, yet IPhone X and Xperia 10 gives memory errors 😄 Each device have it's own mind expecially on webgl 😄

astral wave
#

The thing is non developers like webgl. They like it doesnt need to be on any AppStores. That makes it look more profitable and it makes it popular. Then developers are hired to use webgl. I really interested how they will make webgl multihreaded as they announced on Unite, then it will be biggest change for long long time. But webgl is not update by browsers for rly long time, so what ever you do you will be always behind.

keen urchin
cosmic canyon
#

Can I use photon in a webgl build? I'm going to use it to create a real-time multiplayer in my webgl game.

sweet oriole
remote lava
#

Heyy, i just finished a 3D game. Its size is around 600MB and i want to:

  • make it downloadable on Windows and MacOS, as a desktop app
    All the tutorials i found were on WebGL for itch.io, but when i switch platfrom for my project. Im getting 200+ errors, and i dont really need to run it in browser
    Any other ways i can publish the game?
#

im sure i have a wrong understanding of WebGL. Can you run bigger sized 3D games on it? and can you download WebGL game as a desktop app?

steady spruce
#

Super random issue involving the fullscreen mode on itch.io:
The main menu UI does not scale correctly when I go into fullscreen mode. But if i play a level in fullscreen, pause, and go back to the menu, it is the correct scale. Until I go out of fullscreen, that is. Anyone know why this is happening and how I can fix it?

astral wave
#

GetConfiguration then if it is incorrect AudioSettings.Reset. maybe?

As normaly it just streams audio to default system device, but obviously it doesnt it work 😄 I know Vivox audio plugin can select device. So it is possible, but most likely not exactly by native code. Frustrating isnt it?

#

or just go WebGL way, just use JS

navigator.webkitGetUserMedia(
{ audio: true, video: true }, 
function(MediaStream){
    // success
    navigator.mediaDevices.enumerateDevices()
        .then(function(devices){
            devices.forEach(function(device){
                console.log(device);
            });
        });
}, 
function(){
    // error
}
);

And select device you need.
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices

The MediaDevices method enumerateDevices() requests a list of the available media input and output devices, such as microphones, cameras, headsets, and so forth.
The returned Promise is resolved with a MediaDeviceInfo array describing the devices.

ancient yoke
#

Hey y'all, have a web build of a Unity project that has always given us a huge error message when starting the game, it's never displayed or played correctly. Wondering if anyone who might be able to decipher it is willing to take a look

vocal glade
#

Framerate drops on WebGL when sound is played first time. I'm tried all different memory/compression settings, but doesn't change how it works. Is there some config I'm missing? If there isn't I'll just initialize everything by playing all sounds with zero/minimum volume on start.

vocal glade
#

Actually haven't tested profiler on this one, since it's browser only. Not big - largest ones are about 100kb as wav (so pretty much ~nothing as aac).

#

Could be combined effort of pooling system, particle effect and sound, but doesn't happen without the sounds. On chromium browsers it's so minor it sometimes goes unnoticeable. On firefox it's horrible.

north matrix
#

has anyone ever embedded a webgl build into a kajabi website? Any tips, tricks or tutorials?

sly wave
#

Hello. Is it possible to display on the screen the usage percentage of the browser gpu and cpu in a webgl build? Thank you.

fiery pier
#

is there anybody who can teach me how to implement wireframe green overlay effect on the hololens with three.js?

astral wave
# vocal glade Could be combined effort of pooling system, particle effect and sound, but doesn...

Greetings. It is less of compression format, but more about load type of the file. (https://docs.unity3d.com/Manual/class-AudioClip.html). I really really strongly recomend just build dev with auto connect profiler with deep profiling (allow your borwser to load non save content) and check exactly what causes it. Maybe decomprersing? maybe maybe file is not so good? maybe you start playing multiple of them? As from StarterAssets third person controller example that I tried running on webgl (running with footsteps), it did not cause noticable performance issues, you you might want to try that you and check how it is different.

stone ravine
#

Hello, I'm interested in using TMPro pre release with a Unity 2022.2 project to be able to use the pop-up keyboard in webGL, when on mobile browsers. Is the best version of TMPro for that 3.2.0-pre.3?

charred briar
#

I'd give either photon realtime transport or websockets a try. Either one should let you use unity netcode over the web. The other option is doing something self rolled and using BestHTTP etc.

https://github.com/Unity-Technologies/multiplayer-community-contributions#transports

The good news, is if it is hard, there is less competition 🙂

GitHub

Community contributions to Unity Multiplayer Networking products and services. - GitHub - Unity-Technologies/multiplayer-community-contributions: Community contributions to Unity Multiplayer Networ...

#

You'll be fine. I've been using unity FT now for about 10 years, 300+ projects. Time goes fast. The first few are the hardest :). Eventually it gets easier. You'll know your doing well when you can code all week without pulling up any help docs

daring night
#

I keep getting this error when running my WebGL build in Docker NGinx

Config:

server {
    listen 80;
    server_name localhost;

    location / {
        root /webgl;
        index index.html;
    }
 error_page 404 /404.html;
    # redirect server error pages to the static page /50x.html
    #
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
location ~ .+\.(data|symbols\.json|.js)\.gz$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding gzip;
        default_type application/octet-stream;
    }
    # On-disk gzip-precompressed JavaScript code files:
    location ~ .+\.js\.gz$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding gzip;
        default_type application/javascript;
    }
    # On-disk gzip-precompressed WebAssembly files:
    location ~ .+\.wasm\.gz$ {
        gzip off; # Do not attempt dynamic gzip compression on an already compressed file
        add_header Content-Encoding gzip;
        # Enable streaming WebAssembly compilation by specifying the correct MIME type for
        # Wasm files.
        default_type application/wasm;
    }
}

Any help is really appreciated!

daring night
#

Nope

arctic rose
#

Did you restart the server after changing the configuration

daring night
#

Yes

daring night
#

I manage to make the error to

daring night
#

So i get a 404 on a get call and these are the headers

#

I check in the docker container and it is present ...

#

Nope the loader.js is fine

#

Yes

#

Data.gz and framework.js.gz

#
unity-webgl-demo | 2022/11/21 16:33:16 [error] 32#32: *5 open() "/etc/nginx/html/Build/BuildopenGL.framework.js.gz" failed (2: No such file or directory), client: 172.20.0.1, server: localhost, request: "GET /Build/BuildopenGL.framework.js.gz HTTP/1.1", host: "localhost", referrer: "http://localhost/"
unity-webgl-demo | 2022/11/21 16:33:16 [error] 32#32: *5 open() "/webgl/404.html" failed (2: No such file or directory), client: 172.20.0.1, server: localhost, request: "GET /Build/BuildopenGL.framework.js.gz HTTP/1.1", host: "localhost", referrer: "http://localhost/"
#

Aha its looking in /etc/nginx/html and it is in /webgl !

#

So after making the root correct the next error!
in console: RangeError: Invalid array at BuildopenGL.loader.js:1:5827

#

Why is this so difficult :p

#

So the loading screen is stuck almost at the end whit this in the logs

#

I can try

#

But building whitout compression works only too slow ofc

daring night
#

Its just on the laptop.

#

Using docker compose

high patrol
# north matrix has anyone ever embedded a webgl build into a kajabi website? Any tips, tricks ...

https://help.kajabi.com/hc/en-us/articles/360040196893-How-to-Add-Custom-Code-to-Your-Page Contact their customer service to see if they'll allow you to embed something that works

north matrix
charred briar
#

I usually see that when the server can't decompress the object, and returns an empty array. Resulting in a bad index

#

You can set it to compressed, with uncompressed as a fallback. While you troubleshoot the compression in the meantime.

orchid bridge
#

hey, i'm trying to build my project on webgl, and i'm getting this error:
Error: IL2CPP error for type 'System.Net.WebHeaderCollection/RfcChar'

deep spire
#

Hi, has anyone here run into these errors before? I'm getting this error when trying to send an API call through an HttpClient object

amber ivy
#

Does anyone know how to import npm modules for use in .jslib files?

#

I've been trying a couple ways but none of them work properly

amber ivy
#

I'm building more as an SDK rather than a game, so the goal is to try not to mess with the webGL template too much. Regardless if I have to that's fine. We have an NPM client sdk that we need to initialize from unity and then create a texture with a video frame to give back to unity later

#

Is that something I could do outside of a jslib file? I wouldn't have access to GL.textures there would I?

#

I figured as much. My solution right now is to eagerly load my library and add it to the window object which should be callable from the jslib

#

(that i found after I had asked the question originally)

#

Thanks for your help!

normal compass
#

I am having trouble exporting for WebGL - I have a simple demo with some cubes and whatnot, and when I export for WebGL locally with the editor and play the game in a browser, it compiles and plays, but the scene is "empty" (no cubes or anything), but I can tell that it is starting "the right" scene because my camera controller is working (so I can look around at the skybox). I thought maybe things were strange because I using the Unity editor on Linux, so I tried building using the game-ci/unity-builder GitHub Action, and again the build completes and I can download the build and play it in a browser and it's also this strange empty scene. Any idea what might be going on, and what I can share to help troubleshoot?

#

many, yes, some are suggestive for sure:

The resource Internal-ErrorShader.shader could not be loaded from the resource file!
#
GL.End requires material.SetPass before!
grave cradle
#

hi I try to start a webgl project and want to implement a library. but i get this error on mac.

#

I want to download a nugget package
IotaWallet.Net.Domain
and the error above occurs.
I am on a mac.
I did not find any .net framework 4.7.1 for mac to download an install nor can I change to .net 4x in the player settings

#

or do I have ot make it on windows as .net 4.7.1 seems to be on windows only...?

normal compass
#

FTR, I solved my issue by upgrading to a newer Unity Editor version, ha!

quick token
#

@grave cradle In case you haven't found about it, there seems to be some working solution (or maybe they became partial solutions now) about the .NET Framework 4.7.1 compatiblity with Mac here : https://github.com/OmniSharp/omnisharp-vscode/issues/3063
In short, some seems to have fixed the issue by installing Mono (or upgrading it) from https://www.mono-project.com/download/stable/
(You should read the link I posted above for various sub-cases where some people did a small additional change, based on cases.)

GitHub

Issue Description I get this message in the output of VSCode [fail]: OmniSharp.MSBuild.ProjectLoader The reference assemblies for framework ".NETFramework,Version=v4.7.1" were not...

grave cradle
#

i see the problem is that in my unity project is no Dependencies/Frameworks and net core...

#

How can I add the .net 6 framework to a unity project?

grave cradle
#

or in an other way said: when I create a new project in VS directly i can choose the .net framework and it will be added to the project dependencies. But if I make a Unity project and enter the VS to check the project, I dont see any dependencies and can set anything...

#

I need the framework to install the nugget

#

while I get the .net frameworks automaticall when creating a project in VS I dont get it when I create the project in Unity

grave cradle
grave cradle
#

the solution project form unity refers still to .net 4.71 framework... how can I add another framework and refer to it

#

or how can I implement the vs created project into unity?

lament ridge
#

so i am making a website using HTML and css, I would like to embed my webgl unity game into the website, ive looked on the internet but all the information is outdated

#

does anyone know what I need to do

lament ridge
#

thanks i looked into it apparently chrome doesn’t support unity webgl content

#

so i have to upload it to an external server

sweet oriole
#

Modern browsers tend to have security related restrictions on running local content

lament ridge
#

yeah i figured that was the case. its not a big deal i’m making a portfolio and wanted ease of access

#

it won’t hurt my chances if i direct them to an external link

#

but it definitely could have upped my chances having it directly on the website

sweet oriole
#

Well your website most likely is already hosted and not ran from local filesystem 😄

lament ridge
#

really?

#

let me send a screenshot

#

i dont understand what you mean by static website tool

#

im using html and js for this website

#

i am on windows

#

i most likely dont know any server side programming languages

#

what are some examples?

#

i think so

#

instead of just building the files

#

u want me to build and run, i think i read about this too. thats how i get the address right?

#

ohhh that is sooo unlucky then

#

the project i want to use i lost the source code to a faulty hard drive

#

but i was able to download the we gl files i uploaded to itch.io and thought that would be enough

lament ridge
#

unfortunately nope

normal compass
#

This may have come up before but, I am having a really hard time downloading and playing audio in my WebGL builds using UnityWebRequestMultimedia.GetAudioClip - I have tried most things I am finding online (for example, setting streamAudio to true for the DownloadHandlerAudioClip), and have tried wav, ogg, mp3, and aac, all with no luck. myClip.length is always 0, and the audio does not play (though in the browser inspector, I do get a 200 response with the content-length header correct - and the body /looks/ ok, but I haven't tried to decode the gnarly ascii that the browser inspector shows). Any guidance here would be greatly appreciated!

outer rampart
normal compass
# outer rampart Can you share code? Networked content can be hard in webgl sometimes and have is...

This is how I am trying it now (works for non-web builds sort of, it doesn't seem to download the whole clip, despite the content-length header being correct):

        using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.MPEG))
        {
            DownloadHandlerAudioClip downloadHandler = new DownloadHandlerAudioClip(string.Empty, AudioType.MPEG);
            downloadHandler.streamAudio = true;
            www.downloadHandler = downloadHandler;

            www.SendWebRequest();

            while (www.downloadProgress < 1) {
                Debug.Log(www.downloadProgress);
                yield return new WaitForSeconds(.1f);
            }
            if (www.responseCode != 200 || www.result == UnityWebRequest.Result.ConnectionError) {
                Debug.Log(www.error);
            } else {
                AudioClip myClip = DownloadHandlerAudioClip.GetContent(www);
                Debug.Log("Should be playing a clip of length: " + myClip.length.ToString());
                AudioSource.PlayClipAtPoint(myClip, position);
            }
        }

This is how I used to do it (works for non-web builds):

        using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(url, AudioType.MPEG))
        {
            yield return www.SendWebRequest();

            if (www.result == UnityWebRequest.Result.ConnectionError)
            {
                Debug.Log(www.error);
            }
            else
            {
                AudioClip myClip = DownloadHandlerAudioClip.GetContent(www);
                AudioSource.PlayClipAtPoint(myClip, position);
            }
        }

I have been pointing the url at valid aac, mp3, wav, ogg, that I host. Neither of these seem to work at all for web-builds

normal compass
#

Whelp, I got it to work, at a super low-level - I changed my server to send back raw pcm, and then I convert that into a float array that I can directly create an audio clip out of, and it works on webgl:

        using (UnityWebRequest www = UnityWebRequest.Get(url))
        {
            yield return www.SendWebRequest();

            if (www.result == UnityWebRequest.Result.ConnectionError)
            {
                Debug.Log(www.error);
            }
            else
            {
                var buffer = www.downloadHandler.data;

                short[] samplesAsShorts = new short[buffer.Length / 2];
                System.Buffer.BlockCopy(buffer, 0, samplesAsShorts, 0, buffer.Length);

                float[] samples = new float[samplesAsShorts.Length];
                for (int i = 0; i < samplesAsShorts.Length; i++) {
                    samples[i] = i16_to_f32(samplesAsShorts[i]);
                }
                int channels = 1;
                int sampleRate = 16000;

                AudioClip clip = AudioClip.Create("clip", samples.Length, channels, sampleRate, false);
                clip.SetData(samples, 0);
                AudioSource.PlayClipAtPoint(clip, position);
            }
        }
normal compass
#

As long as I’m allowed to manually fill an audio clip with f32 pcm, I’m happy. But the two code examples above seem quite reasonable, but aren’t working. I’ve tried all of them with mp3, ogg, and aac. I’m using 2021.3.14 or something let me double check

#

yeah, 2021.3.14f1

cosmic canyon
#

Where can I host my webgl builds? I tried using github but my files were too big.

buoyant roost
#

Hi guys, how do I fix this ?

buoyant roost
rotund mist
#

Anyone know if it's possible to store custom vertex attributes in gltf/glb? (or maybe there's other file format?)

sweet oriole
#

Which files were too big? Your web build files shouldn't end up being too big to begin with.

cosmic canyon
ancient cradle
#

When i try to upload my game to itch.io it gets suck at 0% and i get these errors in the console. I uploaded my game before and none of these errors have shown up so i dont get what is wrong now

eternal scarab
#

@ancient cradle is your WebGL compression set to none?

eternal scarab
#

adblocker blocking it?

#

wild guess 😛

charred trout
#

Hey guys! I am having an error while trying to build for WebGL. The game builds fine for windows .exe. Can anyone help pls?

#

I am trying to build the game for a jam and dont have much time 😦

brave crown
#

Hi. Is it possible to upload via FTP, in a WebGL build ? My script can run in editor, but not in the build. It is explained that this is happening due to threading that is not supported in WebGL. Is there another way ?

eternal scarab
charred trout
sweet oriole
vocal glade
#

Are URP decals just totally unsupported? I found some people online who seemed to have them working (and had other problems with them). All I'm getting is as if texture was missing (opaque purple squares) and warning "Shader Shader Graphs/SimpleDecal is not supported: GPU does not support separate MRT blend modes"

#

tried playing around with different settings for decals and creating as barebones decal shader as possible, but no luck

vocal glade
#

well, turns out decals only work in forward mode on webgl

finite glacier
#

does anyone know how to ignore/disable WebGL JS Error?

#

(popup)

#

I have an curl error 28 error timeout

#

however this cannot be NOT logged into unity

#

so everytime there is a timeout, this appears

sweet oriole
finite glacier
#

I've surfed the internet, I dont found a way to catch the curl 28 error

sweet oriole
#

Not aware of anything other than modifying the template to either disable the popup or try to check for that specific error

finite glacier
#

pretty much this error

sweet oriole
#

Switch to a more stable API 😛

#

Where are you getting these?

finite glacier
#

i just use UnityWebRequest with timeout

sweet oriole
#

Was just wondering what was timing out

finite glacier
#

ok I found it

#

try/catch works, however I do it inside Task<>

#

idk abt Coroutine

#

wait It didnt work

sweet oriole
#

Careful with System.Threading on browsers

vocal glade
#

Is there a settings combo for URP decals which would work with angle fade? I’ve tried lots of different settings and can’t find any combination which would work

quiet moss
#

how do I fix this?

#

(this is on itch btw)

quiet moss
#

Yep

#

Changing the compression Method

tidal mauve
#

Hello, I'm got some trouble on chrome, sometime texture won't load like button

#

No problem on brave

#

chrome

#

Someone knows what is the problem

grizzled meadow
#

hey, is it possible to receive the inputs from a laptop trackpad? Input.touchCount is not triggered by my laptops trackpad. i would like to implement pinch zoom and two finger drag for our trackpad users.

sly wave
charred briar
tidal mauve
#

log on brave

charred briar
# tidal mauve my log on chrome

I only see the shader error mentioned above, but it shows on both consoles, so not sure if it is an actual problem. Sorry I realize it doesn't help

tidal mauve
tidal mauve
#

Is it possible to call async function in jslib and get the result in C# ?

charred briar
#

You can pass messages between the JavaScript front end and embedded unity WebGL

astral wave
#
#if USE_THREADS
        workerUrl: "Build/{{{ WORKER_FILENAME }}}",
#endif

soooo I find this in new template of Unity Webgl. Anyone can elaborate on this? And how to use this in first place, as I dont remember that Threads would be supported normaly yet (I know they said they will make it, but that is still future). So is this just for future references? or it is actually possible to use this somehow?

tidal mauve
crude dagger
#

this is the error I got
non of the UI works for some reason but everything is to scaled and anchored correctly

arctic rose
#

Post the console error

crude dagger
#

How do I get the console error

arctic rose
#

Press F12 to open the browser console

crude dagger
crude dagger
#

I've messed with all the scaling and nothing changed it

tidal mauve
high patrol
astral wave
#

anyone can explain where this is coming from?

  1. Quality settings have vsync off
  2. In editor there is no Vsync
  3. I even created this on Update function to make sure that target frame rate is always uncapped.
        if ((Application.targetFrameRate != -1 ) && disableFrameLimitations) Application.targetFrameRate = -1;

Yet I still get this profiler data on webgl build. On different scenes it does get smaller but still exits. Any ideas?

#

sometimes you can see heavy drop down (which is actually means better performance.) Suprisingly then Physics querry get inreased usage. I am so confused.

obtuse cipher
#

How to find log of errors in browser

#

also , game is crashing on itch.io when game over condition is met

tidal mauve
#

So I didn’t need to use send messages or check every second if I have a response

astral wave
storm heron
#

i am using agora voice webgl and geting error of agora any idea how to use in webgl agora.io

carmine mesa
#

So im trying to upload my unity webgl project to itch.io, problem is the outer edge og the project gets cut off, even when i set the embem options to “click to launch in fullsceen”

brave reef
#

Fellow devs, one question. I heard that some players seem to lose their progress they made in my unity webGl game.
I make sure not to save more than once every five seconds ( if there is a reason to save at all of course )
How are you handling that ? I am not using playerprefs, but saving a file goes into indexedDB anyways ?
Thanks in advance

desert nexus
#

So here is my question, I am trying to compile my rust code to web assembly and use this in my unity build. This all works, but we would like to multithread this. I am reading conflicting statements on multithreading in the browser, some state it is possible others say it is not.
Question 1: Is multithreading at all possible? If it is just within the compiled web assembly I am completely fine with that.
Question 2: Are there any guides or resources on how this is done? I have read some posts on it, but this seems expiremental at best.

Also, we are now trying to compile the web assembly with additional libraries, these libraries can be exported to web-assembly and without unity this does not cause any issues, however when we try to import the same .wasm + bindgen into unnity it doesn't work.
Question 3: Is there any documentation on how to setup the .jspre file when compiling Rust to web assembly for unity?
Question 4: Is it at all possible to compile with web assembly using additional libraries? And how is this done?

@sweet oriole (srry for pinging you directly, looking at other questions answered you seemed to know a lot about the topic)

sweet oriole
astral wave
#

Hey I started to get this on unity 2022.2.1. Do anyone know where I can decrease this message size to fit into websocket?

astral wave
#
// Start is called before the first frame update
    [RuntimeInitializeOnLoadMethod]
    static void InitProfiler() {
        Profiler.maxUsedMemory = 200000000;
    }
``` even if I force to use more memory it still uses more than it.

build.framework.js:2788 Stopping profiler. Profiler is not able to flush data to a file or socket and exceeded maximum allowed memory for buffering.
Please use Profiler.maxUsedMemory API or -profiler-maxusedmemory command line parameter to increase maximum allowed memory usage.
Using 200015872 bytes while Profiler.maxUsedMemory is 200000000 bytes.```

astral wave
#

Another question, any idea why Video Player gives such horrible performance with default settings on webgl? I found some forums about it beeing like that for ages, maybe someone could elaborate?

cunning shell
#

Anyone know what is actually this Managed Heap and why is it so big, even bigger than the assets?

astral wave
cunning shell
#

Okay I will look into it thank you!

desert nexus
#

Hey guys I have another question regarding multithreading in WebAssembly using unity, we are using rust compiled to was to load the .wasm in Unity. I have read through the https://web.dev/webassembly-threads/ like @sweet oriole suggested, however no luck so far. Untill now we compiled without any aditional modules, which generates a completely different javascript bindgen.
I believe it is going wrong when trying the convert the javascript bindings into a .jspre file unity can read, here it is trying to import rayon functions as a module but I dont think Unity likes this very much.
Is there anyone who has tried this before, who can give me some pointers on the .jspre file?

web.dev

Learn how to bring multithreaded applications written in other languages to WebAssembly.

#

@sweet oriole Do you know of any examples of multithreading WebAssembly using Rust and Unity? (with or without Rayon)

storm heron
#

webgl pun2 multiplayer voice chat how to add

sweet oriole
astral wave
#

Does ForwardRenderer+ URP works on webgl?

static heart
#

anyone using AWS Cognito with WebGL? If you have it working, I'd love to pick brains, as I'm getting a libc exception.

somber cape
#

Not sure if people follow different channels since there are so many, but here's my problem that involves WebGL as well: #📦┃addressables message

outer rampart
astral wave
# outer rampart Enable it and see. It's not hard to test

Thank you for your very helpfull comment. How in the world I couldn't think about it! (Mind blow). Have you ever tested anything on webgl? you know that is the best platform with fast alteration times, and nothing ever goes wrong there. Testing all features of rendering is super fast and easy way to do you are totally correct. It is way harder to ask community who might have already did that super easy task and are willing to share their experience so other wouldn't need to go over that super easy path of debuging. You are real hero!

astral wave
#

with this you can confirm is it addressables problem or not. Because the loading addressables like you did in example should work,

#

Also you might want to add Await before both operations if you havent.

#

in three days of holidays and work I did not have time to test it. As now I am switching to real time rendering instead of baked one. So Profiling about performance differences and any visible bugs will take time between forward and forward+. Expected answer will be tommorow or today evening (without possibility of small shader problems which hard to find.)

#

I am hobbyist on Unity development and My day job is development on webgl 😄 One I like other I dislike 😄 Our project is multiplayer AWS webgl project, so if you wil have any questions feel free to ask 🙂

somber cape
# astral wave with this you can confirm is it addressables problem or not. Because the loading...

It appeared to be multiple issues on top of each other. I had to remove the Library folder before building, and also had to configure addressables to not compress and to not cache, and then also had to configure the nginx static host to instruct the browser to not cache anything. It's not ideal to not compress and to not cache anything but that's the only combination I got it to work without issues

astral wave
jolly lion
#

Got a question, Can I build a simple unity game in c# and then just export it as a webgl project so I can put it on my website? Not sure how the exporting works

jolly lion
#

Nice, sounds good to me so I don't have to learn 3js. Also what are the reasons that games on Unityplay website are really slow in fps?

desert nexus
#

I have a questions regarding the .jslib file.
I am importing a webassembly library and I can call functions from the wasm in the .jslib through the module created in the .jspre file:
Module["module_name"].function_name()
Now, how do I call a constructor from the .jslib defined in the .jspre through the module?

Normally I would just call 'new' on the type, but how does the syntax work when combined with the module?

coarse fulcrum
#

Hi there, we have been working on a webgl project in our company. Client ask us to do it also facebook playable ads version of it. We've been trying to compress all the files because total size of build folder should be under 5 MB. I know that we should do the project in unity tiny but we dont have "know how" of it.
I have a 2 MB data.unityweb which is fine and we cant compress anymore files.
My problem is with the wasm.unityweb file. It's 4 MB and we need to reduce it to at max 3 MB.
Is there any suggestions on it?
We have been trying since last week. I'm asking here because we're at the end of our solutions that we know.

Unity Version: 2022.2.0b14

fossil spire
#

Hello guys, I am super new to Unity. I just finished learning Unity Essentials Path. I build a game few days ago and published it on Unity Play. But when I tried to play it, it is stuck on 90% while loading. Here is the screenshot. Is there anyone who has ever faced the same challenge. I would be super grateful if someone can help me solve this. Also, I am using Unity 2020.3.39f1

austere tiger
#

I prefer 2021 ... lts

haughty salmon
#

Hey, iam trying to iframe web sites in webgl but it is opening in new tab Or not inside the scene

Is there any way to open it inside scene itself

austere tiger
haughty salmon
#

Thank you! ....
Add on for webgl you telling right?

austere tiger
#

yeah it's web view for webgl as a recall, it's on marketplace

haughty salmon
#

Yes yes it is vuplex

#

Without add on we can't load iframe inside scene?

austere tiger
#

I don't think Unity default tool have that

fossil spire
haughty salmon
astral wave
#

build.framework.js:2793 WARNING: 0:2: 'GL_EXT_shader_texture_lod' : extension is not supported
WARNING: 0:3: 'GL_EXT_shader_framebuffer_fetch' : extension is not supported
ERROR: 0:223: 'bitfieldExtract' : no matching overloaded function found
ERROR: 0:223: 'return' : function return is not matching type:```
Maybe someone know which option adds this shader texture LOD shaders?
astral wave
#

Ichanged graphics settings for Everything baked to everything real time and start getting these lovely errors.

somber cape
#

I'm hosting a webgl build behind a nginx reverse proxy. The proxy reports 504 timeout sometimes for assets that the client tries to download. The assets themselves are hosted in a docker container with nginx static file host server. I have enabled the following but the timeouts still do happen. I wonder if there is something else I can do? The container hosting the static files has 0.5cpu and 512MB ram available to it and it seem to be using less than 0.001 CPU and less than 8MB RAM while serving the files so I'm guessing there is something else bottlenecking the thing?

sendfile           on;
sendfile_max_chunk 1m;
tcp_nopush on;
outer rampart
#

Not fixed in 2022, added in 2022.
The 2022.2 branch should work fine with it and has better WebGL features in general

wet grail
outer rampart
#

Nice!

vocal glade
#

Is it possible to have full canvas size with devicePixelRatio adjusted to it? Or alternatively can you scale the canvas and limit resolution some other way via JS/CSS/html? My project absolutely dies on full size browser and full resolution 4k or 5k. Smaller canvas and fullscreen WebGL works just fine, but I'd like to have that same fullscreen functionality without actually going fullscreen

astral wave
#

Maybe you tested if it supports IME input as well? Aka for languages like japanese or chinese or others?

astral wave
astral wave
#

lI found that disabling Decompression fallback reduces building time dramaticly. But still it is longer than before by huge mark.

astral wave
#

Btw could anyone share their URP Lighting settings they use on WebGL? I am playing for ages now and want to compare my finding with other people

vocal glade
#

So what are your findings? I don't really see what there is to compare, since what is wanted varies between projects

balmy oar
astral wave
astral wave
# vocal glade So what are your findings? I don't really see what there is to compare, since wh...

That WebGL is full of magic. That you need to have always minimum amount of settings on, otherwise it will be overflooded with shaders variants. Forward rendering + does not work and etc.
Tho my personal findings that Baked lighting is amazing for performance, but it add Memory usage. So for webgl mobiles, where memory max is 500mb you come to situation where using Baked lighting reduces amount of devices it actually can run at. So realtime you can run on shity FPS, but at least it works 😄 So I wonder what options people uses in their projects, what combination. Like Only a bit of baked lights and everything else realtime, or only real time, or only baked? As for my super simple project real time lights performance difference with baked is only 10%, which is smaller than I thought it will be.

balmy oar
astral wave
#

remove this line from your code using System.Threading.Tasks; and try replacing all errors that you get with uniTasks

#

as Unitask have pretty much all features. Because webgl hates threading. That is the safest way I think

#

as webgl will not wait for any tasks....

balmy oar
#

yeah - i'm using a library that doesn't use UniTask, so there's one place I can't use UniTask 😭

#

and that's the part that's broken

astral wave
#

Sorry to dissapoint you, you cant use that library then. Or you will need rewrite code on that library, because if that library uses Threading... it is GG.. sorry to hear that.

#

but as long code is open and you can change C# multithreading part it is possible.

#

or wait for a year or so 😄 they kinda mentioned they are working on multithreading. Tho no dates or real annoucments.

vocal glade
#

@astral wave Ok. I haven't delved deep into shader variant thing and don't really know what you mean here. Traditionally shader based forward rendering was done by having different shader for different number of lights, because branching was so expensive. I'm not really up-to-date with how modern forward rendering works regarding this, but sounds possible explanation.
Anway - here are my findings, not all are lighting related:

  • Deferred doesn't really work. It does something, but number of lights was still limited, which didn't make much sense. It did do something though, since decals didn't work at all.
  • Talking about decals - getting them to work was pain in the ass. I didn't find any documentation regarding what should work and it was just lots of trial and error. Didn't help that there seemed to be some bugs and sometimes editor functionality wouldn't update properly and you got impression that the settings worked and only way to find out what's really going on was to either restart editor or make a build.
  • Performance of multiple pixel lights was horrible anyway, but I really wanted pixel lights, so I ended up limiting number to three - one for each player + one for casting shadows.
  • And from there I faked the rest and went with decal-based fake lights, which are rendered into separate texture and use custom shader in post-processing. It's work-in-progress at the moment, but suits the needs of my current project. Need to figure out how to use one camera's depth buffer on another and if it even affects the decal system, until it's usable for anything else.
astral wave
vocal glade
#

well that sounds great

astral wave
vocal glade
#

so, can you project decal to an object on layer 1, but render it on layer 2? :)

astral wave
vocal glade
#

I guess I need to dive into light layers too

astral wave
#

I am using decals to fake underwater effects. as u can see it is not visible on character but visible on other parts ( I enchanted the opacity to be able to see better.)

vocal glade
#

Doing fake light things on decal shader would be very limiting, expensive, hard or impossible, so I have very minimal decal shader and handle the fake light calculations in post processing. This is kind of deferred rendering-esque concept. I currently have very minimal game regarding collision data, so I just have duplicates of collision objects (without actual colliders) with black material, for receiving the fake lights. It kind of sucks, but works. It should be possible to make it work with anything though with screen space decals and using only depth buffer, but might require modifying the decal system.

astral wave
#

but isnt depth on URP is quite expensive?

#

or you not using URP?

vocal glade
#

I am. The depth buffer exists anyway, so I don't know what would be expensive here.

#

Like I think it would work like this: Grab depth buffer from main camera, use that on texture rendering decal camera, which renders nothing else and end result with screen space decals should be texture with only the decals projected on rendered geometry.

vocal glade
#

Submission, distribution

#

I've even seen "Submission Specialist" job title and tbh it really sounds more bdsm than gamedev :D

desert nexus
#

Hey guys I have an interesting question regarding async functions in my .jslib file.
My script component which executes the function does not seem to wait untill the function is executed...

My question:

  1. Is there a way to tell unity to wait for the async javascript function?
  2. If it is not waiting how does it handle return values?
flat badge
#

Who knows what happened?Is it not supported by webgl or is it set up incorrectly,Help me

#

WebGL URP Decal Layers Ineffective

inner bridge
#

Hello, happy new !
I have a weird issue when building on WebGL, the sensibility of my mouse is like x1000 compared to the editor.
I didn't found anything online (except that sometimes the sensibility is x2).
Does anyone knows how to fix this ?

inner bridge
#

After a few test, I noticed that my sensitivity on the WebGL build is really x1000 compared to my Unity editor

vestal cloak
inner bridge
arctic rose
#

better, but still wrong

inner bridge
#

What would be the solution, just not using it ?

arctic rose
#

Don't scale input by deltatime

inner bridge
#

Btw I am not using it on all move/rotate so it is not only linked to that

arctic rose
#

Also why was it fixedDeltaTime? If it's in FixedUpdate that's also wrong

inner bridge
#

Well, I am working on a project made by another dev and I was kind of surprise to see that so thank you too point that out, I'll remove it and test

#

He was also using "LateUpdate" for some reason, should I use "Update" ?

elfin juniper
#

tryign to upload to ld and getting this error can someone help

Uh oh!
If you're seeing this error, it means I can't find your index.html file.

This usually means you created your .zip file by zipping the entire folder, and index.html is somewhere like MyGame/index.html. If you recreate your .zip with index.html file in the root, this error should go away.

See the embedding guide for more details. ludumdare.com/resources/guides/embedding/

404 Not Found

its 4am i need help

half parrot
#

Hey, I have a message thats supposed to fade in after my boss fight, and it works in the editor player... but it doesnt work in the webGL build

any idea why?

I'm using TMPPro and the script is pretty simple
just using an event to activate a game object, and once the GO is activated, it does

if (TMPR)
        {
            if (TMPR.color.a < 1)
                TMPR.color += new Color(0, 0, 0, 0.5f * Time.deltaTime);
            else
            {
                if (nextObject && !triggerNextByEvent)
                    nextObject.SetActive(true);
            }
        }```
#

like, is it just failing to get the TextMeshPro component in the webGL build??

#

if so, how can I fix this?

astral wave
# half parrot Hey, I have a message thats supposed to fade in after my boss fight, and it work...

Hello dear Ori,

Adding the error log would help a lot. You can do that on browser pressing f12 you will see console with logs. For exact error code you will need to enable devbuild and in publish player settings full stacktrace. This will show the error.

Most likely what happens on webgl is that order of initialization is different.
a) SpellCasting.e_OnSpellCast += CheckForHealCast; event is not registered correctly. Aka it tries to be registered before spellcasting is actually initiated.
b) some of you if statments do not return correct value. To make sure you will need to add debug log in places and check how it changes values manually. Sadly webgl is not friendly with debuging.

Anyways my guess this script tries to access something that still does not exists. Simple workaround when you access different scripts check if they are there, and if not reassign it again.

half parrot
#

I think the order of init is the issue

I remember having a similar issue in the past, over a year ago, and the order of start vs awake I think was the issue back then
I'll try a couple things first, but if they fail I'll do a dev build and see what happens

#

Also, the OnEnable is irrelevant to the issue I'm having at the moment, thats a part of the script that only is used in special circumstances, and not being used here where I am having this issue

#

alsoalso, I dont think a. is an issue, as SpellCasting is a script that is loaded in a separate scene with other core game scripts, before the level is loaded. it will always be intialized before anything in the level is even awake

#

as for the if statements, the script has been working fine up until now. I was udner the impression doing an if statement on a component returns false if the value == default, and true if it is anything else

half parrot
#

fixed it
so it seems what was going on was OnDisable was happening in the webGL build, unsusbscribing the script from the event, despite the object supposedly starting as inactivate

in the editor mode, the scene was already loaded so it wasn't an issue, but in in webGL it was

#

I guess when a new scene is loaded, all object are loaded as active, and then set inactive after awake

hollow blade
#

So, I'm upgrading a webgl project from Unity 2020.3.38f1 to Unity 2022.2.1f1...

I'm getting the following error in 2022.2.1f1 (works fine in 2020.3.38f1) - this is at load time and everything just freezes (progress bar stops ~90%). I don't see anything different in the template html (e.g. createUnityInstance params look identical).

I don't see any 404s or other errors in the network tab of developer tools. Executing in incognito tab so nothing is cached. Chrome Version 108.0.5359.125 (Official Build) (64-bit) on Windows.

I can sort of manually trace through the minified build.framework.js calls and see them there but have no clue what they're doing or what is trying use document.querySelector with # - from the call stack I'm guessing it's trying to bind keydown events, maybe related to the input system? Maybe the canvas?

Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#' is not a valid selector. at findEventTarget (http://localhost:8000/build/Build/build.framework.js:10:236557) at registerKeyEventCallback (http://localhost:8000/build/Build/build.framework.js:10:263148) at _emscripten_set_keydown_callback_on_thread (http://localhost:8000/build/Build/build.framework.js:10:263463) at http://localhost:8000/build/Build/build.wasm:wasm-function[111901]:0x1dbcdb6 at http://localhost:8000/build/Build/build.wasm:wasm-function[111898]:0x1dbc3ac at Module._main (http://localhost:8000/build/Build/build.framework.js:10:365581) at callMain (http://localhost:8000/build/Build/build.framework.js:10:479511) at doRun (http://localhost:8000/build/Build/build.framework.js:10:479958) at run (http://localhost:8000/build/Build/build.framework.js:10:480130) at runCaller (http://localhost:8000/build/Build/build.framework.js:10:479170) at Object.removeRunDependency (http://localhost:8000/build/Build/build.framework.js:10:15586) at http://localhost:8000/build/Build/build.framework.js:10:1913 at doCallback (http://localhost:8000/build/Build/build.framework.js:10:146856) at done (http://localhost:8000/build/Build/build.framework.js:10:147010) at Object.reconcile (http://localhost:8000/build/Build/build.framework.js:10:140291) at http://localhost:8000/build/Build/build.framework.js:10:136396 at index.openKeyCursor.onsuccess (http://localhost:8000/build/Build/build.framework.js:10:138147)

I haven't seen anything online or in the forums so I thought I'd try here.

Any ideas? Known issue? Might be able to give more info or answer questions, if helpful.

high patrol
#

If you're using the Resources folder it can significantly add time to that

astral wave
#

it takes 25mins per build for me

astral wave
#

also 2022.2.1 have increased build time sadly.

outer rampart
#

(@orchid bridge)

#

For the same project build times should reduce or stay the same

astral wave
outer rampart
#

Ah alright, cool

astral wave
#

Our build increased by around 10-15 minutes if warm.... If not...... God help me 😄

outer rampart
#

Oof, thats not great indeed
Which version were you on and did you already delete the library folder?

astral wave
#

problem was emscripten version update. Some users were able to reduce building times by replacing 2022.2.1 with 2022.1.23 or 2022.1.21 version emscripten files.

#

yes indeed I deleted library after unity update, as it was not building at the start at all 😄

#

Currently I am on 2022.2.1f1

outer rampart
#

Ahhh interesting

#

Thanks for the info!

hollow blade
hollow blade
#

Yup. Inside a SPA.

#

Of course!

#

Vue

#

Choice was made by someone many moons ago, who is no longer around. Guess would be it's an "better developer experience" or something. It's not a terrible choice... we're doing a bunch of other stuff besides Unity so makes sense. Also a source of many issues which get blamed on the Unity side. 😦

hollow blade
#

With regards to Unity, you have to be careful with memory usage from the SPA which is shared. Caching of unity instances is another one.

stone ravine
#

I'm on 2022.2, I have my game exported for WebGL. All sounds play perfectly on PC browsers and android. On iOS I get no sound. Any idea what the problem could be?

astral wave
# stone ravine I'm on 2022.2, I have my game exported for WebGL. All sounds play perfectly on P...

welcome to iOS. Most likely is because of security policies on iOS browsers. Trick is, no video or audio can be played without user request. Aka you need to click at least once first before you can try starting audio stuff. And Unity webgl clicks does not count 😄 There are multiple tricks for that, creating invisible HTML button to press, or create HTML pop up before game. I find out that you can use unity event: OnPointerDown() to trigger media unlock for iOS. I have button in my game which says; Tap to unmute. But what this button actually does, it is event onpointerdown (not on button click!!!) and it start audio.

solemn current
#

hi, im getting this error when trying to upload to itch.io. i followed multible tutorials but they all result in this error. i have no idea how to fix this.
Anybody that can help?

astral wave
solemn current
#

ill try that now

solemn current
astral wave
solemn current
astral wave
#

it is really a BossGame. But froxe on start button :DDDDDDD no bugs 😄

#

ohhhh or it is all there is to it?

#

ohhhhhh there is no mouse support, got it

#

my bad

open compass
#

I have found a game on itch.io I would like to embed in my own project. It is open source.
itch.io: https://primozov.itch.io/zombie-retro
game source: https://github.com/lucaslprimo/ViceZombieCity
I would like to be able to click on an item in my scene and have the game pop up and play without leaving my parent environment.
Is this possible?

itch.io

FPS Shooter Retro Style with Neon Zombies

GitHub

Low Poly FPS Game with Zombies made with Unity. Contribute to lucaslprimo/ViceZombieCity development by creating an account on GitHub.

astral wave
#

Otherwise your only option to open it in another window or create aditional canvas with loading different webaddresses.

open compass
#

can you describe what you mean by an "additive" way? The way I envision it is to have the original scene visible in the background but greyed out, and the game in the foreground, taking up 80% of the screen.

astral wave
#

In unity you can load new scenes in two modes: Single or Additive. Additive means everything that is in current scene will stay there. In this way you will have two games running at the same time. For further control you can use cameras stacking to control what and how will be seen. But have in mind multiple cameras or multiple games at the same time will consume way more resources, and webgl is not shining with performance already. So you might want to create some of fake workaround, like making screenshot of background, render it as bakcground and meanwhile disable everything or even unload your main game assets. But for starters the easiest implementation is addressables + Additive scenes + camera stacking. Both have quite a lot of example and tutorials, so I suggest investigate it

#

but I would suggest having as minimum cameras as possible in your game, as rendering is the most expensive thing most likely,

open compass
#

Excellent advice, thanks so much for explaining

stone ravine
gentle zealot
#

i tried to build my game to WebGL to put on itch.io but when i run it from itch.io it says Unable to parse Build/WebGL.framework.js.br! This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: br" present. Check browser Console and Devtools Network tab to debug.

sweet oriole
clever lion
#

anyone yet tried 2022.2.2 for webgl?

#

Build time on 22.2.1 is horrible

outer rampart
clever lion
#

🥲

#

having this on very small webgl builds

outer rampart
clever lion
#

I can't, I rely on 2022.2

#

🙃

clever lion
#

22.2.2 just got released

outer rampart
#

I think they aim for a release every 2 weeks

#

So test without webgl if possible untill then and only make release builds with webgl?

clever lion
#

nah, I have to endure pain

#

since I am testing features on webgl specifically

#

😅

outer rampart
#

Ahhh then thats a yikes

#

Hope it releases soon!

charred briar
#

The last version we tested failed on our Android, VR, and WebGL test scripts. We haven't tested it in a while now though

clever lion
past vale
outer rampart
#

Pictures and gifs @past vale

past vale
#

ok thanks

astral wave
clever lion
#

Or subscenes

astral wave
#

does it gives you enough improvements without Jobs and multithreading?

#

or it is more testing purposes with hope Dots will come to webgl in the future? 😄

clever lion
astral wave
astral wave
#

have you done testings how much performance increase it gives you?

clever lion
#

I don't test ietfomance

#

My project is simple quest 😅

astral wave
#

Well burst compiler does miracles with jobs, and all examples were provided with jobs pretty much. So I assumed it does not go well or is worth

clever lion
#

it is definetely worth to use burst whenever

#

You don't need entities ot jobs for it

astral wave
#

But burst compiler requires you tu run simple mathematics. On basic projects what does it give? Like physics is not on burst, raycasts also not so much, if you dont do mathematics every frame how does it improve performance. I have burst "enabled" , but never added any tags to use it 😄

clever lion
#

You convert your heavy logic to it

#

Everytime you have big loops

#

Yoy can try burst them

#

And get x4 perfomance

#

With vectorization

astral wave
#

but thank you for proving me wrong, that entities and burst is reasonable to use on webgl, I will double check if I can increase performance anywhere with that. What mainly you use it for? Like character controller? interactions between objects?>

clever lion
#

Nah, nothing like that

#

It's pure math for me

#

It's economy management quest

#

But

#

I used to make a semi flappy bird game with entities too

#

I gave up for now, cause 1.0 entities graphics is too unstable (also propably incompatible with webgl atm)

#

It's mostky ecs atchitcture that I am after

astral wave
#

We are using Mirror library with Insight (mirror master server for scaling) for multiplayer. It runs on AWS servers. I can highly recomend mirror, as community is really good and they constantly improving it. But for faster development Unity netcode is really good as well, as you can use their matchmaking and gateways for free while your project is small. Depends on how much power you need. If you will need crypto stuff I think it would be easier to go with your own server or AWS or others. where you have more control.

wraith nymph
#

Hello, I have a problem. I just finished my game and had it built for windows and webgl. The Windows version of the game runs perfect as expected, but in webgl, some unexpected behaviour is happening when the game is running. The webgl version is executed properly, I have gone to its home screen, and other stuffs, howoever there is this bug which affects the gameplay massively. What settings can you recommend for me to be able to build the webgl version properly? I've tried running my game on itch and simmer, but both of them had the same results. I don't think the problem is with my code since it's working perfectly on game mode and the windows version of the game, so the problem might be with the build. What webgl settings can you recommend when building it?

astral wave
#

Yes that is correct. We manage project ourself, as it integrates other weeb interfaces a lot, so it is easier this way.

astral wave
stray osprey
#

cannot import assets when editor is importing or compiling assets its doing neither

astral wave
#

Have you tried restarting Editor? have you tried restarting pc?

For me sometimes it stuck on switching platforms until I kill process and reopen it. but it depends on situation 😄

#

closing your code editor sometimes helps as well

astral wave
# stray osprey still erroring

Close your editor. Close everything. go to your project. Delete everything that is in your Library folder. Open project again. Have in mind it will take longer than usual to start, as it recompile stuff.

astral wave
#

iOS audio source question. Please have in mind that everything works on Android, Windows,

  1. I have script which downloads song
var dh = new DownloadHandlerAudioClip(url, AudioType.MPEG);
        dh.compressed = true;
        dh.streamAudio = false;
<..bla bla bla waiting for donwloading.. >
return dh.audioClip;
  1. then when it finishes apply on audio source and Plays()
  2. Super simple. BUT on iOS does not play any sound. Neither when click on button to play. Logs says that audio source is not null and it starts. No errors, no warnings.
  3. if audio clip is in the build, and not downloaded, it does play when I press play.

Any ideas? Only clue maybe because compressed = true? but have no idea at all why. Because as I mentioned, on android there is no problems, windows no problems.

#

Behavior same on safari and chrome.

astral wave
#

mp3 or wav, same thing....

outer rampart
#

Use debug logs to see if there are errors, what the audioclip is, etc

astral wave
astral wave
#
public IEnumerator DownloadAudio4(string downloadLink)
    {
        Status.text = "Download started";
        var dh = new DownloadHandlerAudioClip(downloadLink, AudioType.WAV);

        //dh.compressed = true;
        //dh.streamAudio = false;
        using UnityWebRequest request = new UnityWebRequest(downloadLink, "GET", dh, null);
        request.SetRequestHeader("Access-Control-Allow-Origin", "*");
        yield return request.SendWebRequest();

        if (request.result == UnityWebRequest.Result.ConnectionError)
        {
            Debug.Log(request.error);
            Status.text = "Download error";
        }
        else
        {
            //AudioClip myClip = DownloadHandlerAudioClip.GetContent(www);
            BGMSource.clip = dh.audioClip;
            Status.text = "Download completed";
            Debug.Log("Download completed");
        }
    }

Anyone know why this dont work on iOS only? I reduced the cause is when file is downloaded something goes wrong and it does not play. Wav and mp3 have same behavior. All completes succesfully without problems. yet no Sound. If file is included in build, that sound plays. SOmething with iphones and their decoding or something?

#

And yes there is a button that starts play() 😄

astral wave
#

 public IEnumerator DownloadAudio4(string downloadLink)
    {
        {
            using (var uwr = UnityWebRequestMultimedia.GetAudioClip(downloadLink, AudioType.WAV))
            {
                ((DownloadHandlerAudioClip)uwr.downloadHandler).streamAudio = true;

                yield return uwr.SendWebRequest();

                if (uwr.result == UnityWebRequest.Result.ConnectionError)
                {
                    Debug.LogError(uwr.error);
                    Status.text = "Download ERROR";
                    yield break;
                }

                DownloadHandlerAudioClip dlHandler = (DownloadHandlerAudioClip)uwr.downloadHandler;

                if (dlHandler.isDone)
                {
                    AudioClip audioClip = dlHandler.audioClip;

                    if (audioClip != null)
                    {
                        BGMSource.clip = audioClip;
                        Status.text = "Download completed";
                        Debug.Log("Download completed");

                    }
                    else
                    {
                        Status.text = "Couldn't find a valid AudioClip :(";
                    }
                }
                else
                {
                    Status.text = "The download process is not completely finished.";
                }
            }
        }
    }
#

This does not work either. Is it because iOS don't support something?

astral wave
#

Created 7 different methods of downloading wav or mp3. Nothing Helps... even ChatGPT is out of options

clever lion
#

Is there a way to have some editor code that will add additional html code into index.html of build?

astral wave
clever lion
#

I have 2 sdks, for 2 different platforms

#

sdk manual suggest adding js scripts manually in index.html

#

is template what I'm looking for?

astral wave
#

Yes, template is what you looking for. Well you can always edit manually after build, but template lets you do that automaticly on every build.
Or you can add to template to read some specific javascript,which you can change whenever without needing to rebuild.

clever lion
#

Is there some kind of pattern for embedding different SDKs into game per platform?
I have WebGL app I want to release on 2 different platforms with 2 different SDKs.
And I'm trying to figure how to properly develop it, to avoid writing same code twice. But sadly, in order to embed SDK I'd need to modify WebGL template, which is really app specific.

#

I'm considering creating a common wrapper that will send/receive events depending on enabled sdk

clever lion
#

Anyone familiar with JS?
If I do this in <head> of html page

<script>
var myVar;

//Some Init method that initializes myVar
</script>

Can I then access myVar in other scopes?
I'm trying to tie sdk with Unity scripts

hollow blade
#

I'm upgrading a webgl project from Unity 2020.3.38f1 to Unity 2022.2.1f1...

Has anyone had issues with shaders (pulled from asset bundles, which we can't update) that worked in older versions of Unity but stopped working when upgrading unity versions?

I've posted some details here:
#archived-shaders message
#💥┃post-processing message

astral wave
astral wave
atomic kettle
#

Can I use structs in Webgl?

#

My current code is bugging becouse of a system i made with struct, every time I try to access the matrix of Structs the build stops working but the desktop test works properly

arctic rose
#

Considering that things like vectors are structs, it would be pretty hard to do anything if they weren't supported

atomic kettle
#

hmmmmmmm, soooo... yeah I dunno what is happening, will try some extra tests before comming here again

atomic kettle
#

!code

somber questBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

atomic kettle
torn pagoda
nocturne heath
#

2022.2.2f1 is out but no improvements on webgl build times..

torn pagoda
atomic kettle
#

either to get what is inside or to get the length

torn pagoda
atomic kettle
#

damn, there I go again having to use structs to get around a unity lack of adaptability

charred briar
#

It's pretty important to note that Unity WebGL handles memory very differently. Garbage collection isn't immediate, so looping and iterating can overrun the memory quite rapidly depending on the datasets.

#

So a multidimensional array could very easily use it up.

#

You can also try overriding the memory limits and using different browsers as the limits are handled differently per browser, to try and see if that is the root cause.

#

But I've also seen Unity cause some interesting errors in WebGL with loosely defined fields. But I'm not seeing that issue in your code.

tired relic
#

Hi, I have a simple question about Unity WebGL builds. Would it be possible to run an online multiplayer unity game that runs on the browser ?

high patrol
#

Yes

outer rampart
#

2022.2.3 is out and should improve build times!

slate phoenix
#

Happens when running the WebGL build made with Unity 2020.3.15f, can anyone point me in the right direction?

sly wave
#

Hi!
I'm trying to use these lines in webgl but they have no effect. The chrome console does not report any warnings. In editor they work fine. Any suggestion? Thank you

        Graphics.Blit(renderTexture, textureSupport, mMaterial);
        Graphics.Blit(textureSupport, renderTexture, mMaterial);
torn pagoda
sly wave
uncut bluff
#

Hi everyone, does anyone know how to turn on CORS on the Unity gaming services bucket to build to webGL? I've tried looking for the menu for CORS in the bucket but haven't found one.
thank you.

torn pagoda
uncut bluff
#

Access to fetch at 'blablabla' from origin 'http://localhost:63908/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

@torn pagoda i got that from the inspect console

torn pagoda
#

However you fetch your data, you need to do it with a correct header,n ot xml, that was crossdomain policy, my bad 😄

#

That might help

uncut bluff
uncut bluff
torn pagoda
#

Oh, I guess your issue is, that you are trying to get a web service response to your local service. Unity Gaming Services might not allow that. what are you trying to fetch, can you show the code thats calling it?

#

Urghs, please use codetags 😄

#

!cs

somber questBOT
#

You can format your multiline code block with C# highlighting! Just add cs to the start of it. Highlighting example below!

class Fluffs : FluffyCat
{
    public void PetCat ()
    {
        Debug.Log ("Petting Cat.")
    }
}
torn pagoda
#

!code

somber questBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

torn pagoda
uncut bluff
#

Like this? @torn pagoda

#

i try to get background image on bucket Unity Gaming Services

arctic rose
#

Note that setting the header in the request does nothing, it has to be set on the server

#

Does the request work in the editor?

uncut bluff
uncut bluff
arctic rose
#

It's saying that it enables CORS automatically

#

Open the network tab in the browser's console and check that the request it sends is correct and it gets the correct response

uncut bluff
#

@arctic rose here it is, get error code 301

#

wait, I want to do something

#

still get the same error, do you have any previous experience with this? @arctic rose

arctic rose
#

Does it open the file if you right click it in the network tab and choose "open in new tab"?

uncut bluff
arctic rose
#

Ok. Then I don't know, sorry

uncut bluff
neon matrix
#

when i try to build my project with webgl, the build with this loading bar always takes up to over 5 minutes. does anybody know how i can shorten that time

arctic rose
#

Only 5 minutes? That's very fast

neon matrix
#

so its normal that it takes that long?

arctic rose
#

No, usually it takes much longer

torn pagoda
#

And as said, 5 min is quite fine depending on the resources

neon matrix
#

okay thank you

clever lion
#

😅

keen urchin
#

My average for WebGL is about 10-15 minutes
1-2 minutes for Windows build, conversely

nocturne heath
#

I went from 25mins builds in 2022.2.2f1 to 45mins builds in 2022.2.3f1 😔.. no changes to the game

charred briar
#

We have projects in the 40GB range that can take over an hour. It just depends on how big everything is

charred briar
#

Sorry, yes and no. We have games that have a 40GB repository but those are desktop/VR. The biggest web project we've done is about 100GB total. Specifics in this as a thread if you are curious 🙂

lone loom
#

what did i do wrong?

#

my first time exporting a project

charred briar
lone loom
#

okay thanks

lone loom
charred briar
# lone loom okay thanks

Yup! I'd set it to compression anything then check Decompression Fallback though for the best of both worlds

lone loom
#

It works

charred briar
signal flame
#

I have a webGL build using URP that renders normally in the editor but when its built the camera doesn't render anything but the UI. the game sounds like it is running normally in the background and the console isnt showing any errors (its not showing the console at all actually but iirc the console doesn't come up in a dev build unless there is an error). Sorry if this is a bit basic ive been out of unity for a bit and I cant seem to find anything with google

signal flame
#

oh my god i think its the fucking canvas

#

probably solved this one

orchid bridge
#

I got a question, when i publish my game, the canvas works, when i then run the game on a different monitor the canvas either gets to small or to big, how can i fix this?

charred briar
#

For example, adding a canvas scaler set to screen resize at 0.5f, with the base resolution your ideal test resolution

rancid wedge
#

Hey, theres an issue with my shader where it makes the actual game just black. The UI is there though, just the stuff the shader affects. I think its not a shader issue and a webGL issue because it works fine in windows builds. When I take the shader out the webgl build it works fine, this issue was fixed for my windows build by adding it here. Is there a similar option for web build settings?

#

I thought this setting would work for both but I guess not

merry mountain
#

so anyone have any idea why my WebGL build is not working when i upload it to Itch.io? the game starts to load then freezes near the end and there's a "Uncaught SyntaxError: illegal character U+FFFD" in the console

#

oh wait im an idiot i thought i had changed the compression from Brotli to Gzip in player settings bc itch.io doesnt support brotli but i guess it hadnt saved. no problems at all now

outer rampart
vapid aspen
#

Hey guys, if you are planning to have a WebGL build in addition to the mobile build, would you create a new project for the WebGL version, or create a different branch in the same version control, or just have #if #else cases to handle different SDK initializations??

charred briar
#

#if

#

I don't recommend fragmenting a code base if it can be avoided

vapid aspen
wet grail
#

Don't toggle on "Development Build" it will build much faster. Also usually it takes long time only to build the first time, subsequently it takes much less.

orchid bridge
#

I have a few questions:

How do I fix bugs that only happen in the WebGL build?
Are there any common crashes that are WebGL specific?
Is there a way to access the actual error logs?

#

Also what does this code do:

FS.syncfs(false, function (err) {
  if (err) {
    console.log("Error: syncfs failed!"); 
  }
 });```
Found in https://docs.unity3d.com/Manual/webgl-debugging.html
"Call the following code to make sure Unity flushes all pending file system write operations to the IndexedDB file system from memory"

Is this something to make sure data is deleted, saved or loaded?
And what is FS?
#

Also I've noticed I'm getting this error in the javascript log
Is it related?
warning: 2 FS.syncfs operations in flight at once, probably just doing extra work

#

The crash/freeze is something that happens about once every 20-40 minutes when changing scenes. No idea what causes it

orchid bridge
#

The .jslib code:

mergeInto(LibraryManager.library, {

function syncDB() {
FS.syncfs(false, function (err) {
    });
}

});```
#

The C# code:

    [DllImport("__Internal")]
    private static extern void syncDB();

    void SaveWebGL()
    {
#if !UNITY_WEBGL || UNITY_EDITOR
        return;
#endif

        syncDB();
    }```
#

I changed the syntax slightly and that seemed to fix it

mergeInto(LibraryManager.library, {

syncDB: function () {
FS.syncfs(false, function (err) {
    });
}

});```
edgy phoenix
#

I'm having an issues with webgl + windows 10 display scaling. When scaling is greater than 100% (native resolution), the coordinates in my game get all messed up.

Oddly, this doesn't happen at all in the "play" mode in the editor itself.

Very easily reproducible but I'm not even sure where to start looking for whatever would be sensitive to display scaling - just poking around player settings now.

Any thoughts?

#

Hmm... fiddling with devicePixelRatio in the generated html seems to "fix" the issue.

astral wave
# edgy phoenix I'm having an issues with webgl + windows 10 display scaling. When scaling is gr...

just o be clear, WebGL doesnt rally have anything in common with operating system, it is more about the browser. But what you find is one of approaches, but the key element is understanding that Untiy editor is just half of webgl, you will need to edit WebGL template, css maybe even javascript in order to make sure the canvas will be scaling correctly on every device and browser.

You can solve the problem you have with correctly setting up css of canvas object.

half parrot
#

Hey I am having a problem of some shader-fu I'm doing not working in webGL

Sprite MaterialToSprite(AfterImageParams e)
    {
        RenderTexture _renderTex = new RenderTexture(e.playerAIRT.width, e.playerAIRT.height, 24);
        _renderTex.filterMode = FilterMode.Point;
        Material _shaderOutput = e.shaderOutput;
        Rect _rect = new Rect(0, 0, _renderTex.width, _renderTex.height);
        Graphics.Blit(null, _renderTex, _shaderOutput);
        Texture2D _texture2D = new Texture2D(_renderTex.width, _renderTex.height, TextureFormat.RGBA32, false);
        _texture2D.filterMode = FilterMode.Point;

        RenderTexture.active = _renderTex;
        _texture2D.ReadPixels(_rect, 0, 0);
        _texture2D.Apply();
        Sprite RT_Sprite = Sprite.Create(_texture2D, _rect, new Vector2(0.5f, 0.5f));
        return RT_Sprite;
    }```
#

I've been googling around a bit and it seems RenderTexture class may be the culprit here? I found some things saying that its not supported by webGL
what I'm doing here, in short, is turning the output of a shader into a sprite, through a multistep process
is there another way to get a sprite out of a shader ouput that doesn't involve RenderTexture??

or some other way to get this working on webGL?

half parrot
#

ooh interesting, I'll take a closer look at this in the morning, thank you

cinder creek
#

Guys, it's 2023, why did it take my Webgl build 53 minutes to build a small project?

half parrot
#

the material I'm using is being passed in via AfterImageParams and is a material in my assets that has the shader assigned to it

#

would it make a difference if I got my material from the code?

#

via Shader.Find and making a new material(shader) ?

half parrot
#

ugh, prototyping webGL builds sucks... takes like 5-10 mins to build each time

half parrot
#

I tried passing in the shader via AfterImageParams and creating a new Material from it during my method

Shader _shader = e.shader;
Material _shaderOutput = new Material(_shader);
Graphics.Blit(null, tempRT, _shaderOutput,0,0);```
#

still no good

half parrot
#

biggest problem is I still am not entirely sure what part of my code/process is causing it to not work in webGL

is it the RenderTexture class?
is it the Sprite.Create?
is it the Graphics.Blit?

tribal bluff
#

Is it possible to play videos in WebGL? I’m trying to implement cutscenes that‘ll play after each world.

#

I’ve tried streaming the cutscenes from GitHub, but it almost never works. When it does work, it takes a long time to load.

half parrot
#

ok so I did a bit of debugging...
I have 3 MeshRenderers in my scene
The first one is assigned the output of my shader as a material

The second is assigned to the temporary render texture that is created in my above method

and the third is assigned the Texture2D that is filled in by Graphics.blit()

#

All three of them work in the unity editor in play mode

#

however, in the webGL build only the first one works
the second one displays as a black box when its empty, and nothing (transparant) when a temporary render texture exists

and the third is just not displaying at all (the texture2D post blit)

so the breaking point here is the RenderTexture...

not only can it not be displayed in webGL, it seems like it just doesnt function at all, or the blit and Texture2D would also work

#

I'm very confused about this though, because I am using render textures in other places in my project, and those work just fine

half parrot
#

The part that seems to not be working here is the Graphics.Blit()

#

in webGL, its just not copying the material texture to the render texture

#

omfg I finally got it working.

#
Sprite MaterialToSpriteWebGLMinimal(AfterImageParams e)
    {
        Texture2D _texture2D = new Texture2D(e.playerAIRT.width, e.playerAIRT.height, TextureFormat.RGBA32, false);
        _texture2D.filterMode = FilterMode.Point;
        Rect _rect = new Rect(0, 0, _texture2D.width, _texture2D.height);
        Graphics.SetRenderTarget(e.playerAIRT);
        GL.Clear(false, true, Color.clear);
        Graphics.Blit(null, e.playerAIRT, e.shaderOutput, 0);
        RenderTexture.active = e.playerAIRT;
        _texture2D.ReadPixels(_rect, 0, 0);
        _texture2D.Apply();

        Sprite RT_Sprite = Sprite.Create(_texture2D, _rect, new Vector2(0.5f, 0.5f));
        return RT_Sprite;
    }```
#

The key here is NOT trying to create a new RenderTexture at run time. Use one that already exists in your assets, and clear it with GL.Clear() everytime you re-use it

#

webGL appearantly does not allow you to create new RenderTextures at runtime

astral wave
tribal bluff
astral wave
#

https://docs.unity3d.com/Manual/StreamingAssets.html

In simple words, you create Folder named StreamingAssets in your project and everything that is inside that folder will be included automaticly in your build. That will also create folder in your webgl build, and all files there will be accessible from inside game.

#

Please check common practices for webgl accesing of streaming assets.
To read streaming Assets on platforms like Android and WebGL , where you cannot access streaming Asset files directly, use UnityWebRequest. For an example, see Application.streamingAssetsPath.

#

with this approach you can create script which generates the path automaticly depending on platform and test it on editor and webgl without requiring extra code editing

orchid bridge
#

Any way to see the current framerate of a webgl build? In editor we can always click the Stats button, but in webgl not really?

clever lion
orchid bridge
#

indeed seems very simple

#

thank

clever lion
warm tartan
#

Hey guys,

I have a 3D game I was making so far in the PC/Windows workspace, but my eventual goal was to put it on WebGL.

I finally converted to WebGL workspace, and it works fine, no lighting issues or anything like that.

But when things like projectiles/VFX or anything like a new material appears for the first time, it lags the FPS down to like 3 frames, and then it's good again.

Anyone know how I can solve this?

plain shard
half parrot
#

I tried everything I could, did lots of debugging... the point of failure was always creating a new RenderTexture

#

got around it by re-using an existing RenderTexture

astral wave
warm tartan
#

I don't do any tasks or thread stuff either, so not sure why there's hiccups

astral wave
cerulean crag
#

Hey gang, would anyone have a minute to help me with some strangeness regarding SetTemplateCustomValue and WebGL templates?

lapis compass
#

Hello, does anyone know why my webgl game doesn't take keyboard input just mouse, it works fine in unity editor, but when i build and test in web it doesn't register any keyboard press, just mouse inputs, im using unity 2019.4

clever lion
#

Bruh, video can't be embedded in webGL

#

this is so annoying

astral wave
orchid bridge
#

Hey can someone help me I get this error when I ran my webLG game on itch.I’m

astral wave
clever lion
clever lion
#

editor

astral wave
# clever lion editor

try adding mp4 to StreamingAssets folder and tell me if you still get an error. As it does support mp4

#

and waht error you are getting? What platform you are using? and what asset managment you are using?

#

For webGL you most likely will want to use webrequest to access mp4 as asset

clever lion
#

interesting, in StreamingAssets folder it doesn't even recognize it as video

#

I am on Windows, Unity is at WebGL

astral wave
#

what encoding was used for mp4?

clever lion
#

auto

#

here the warning it throws

#

as I brought it back to normal assets folder

astral wave
#

Ohhh this 😄

#

on webgl you cannot reference file directly

#

What you need to do, is go to your video player, and change source from video clip to URL. and when url is selected you can actually select file you want.

#

During gameplay, you will need to write code, that will adapt to your domain and then goes to streaming assets and loads video. or you will need to use webrequest to get media from your own streaming assets folder (or anywhere else IN YOUR DOMAIN)

clever lion
#

what would be url for root streaming assets folder?

astral wave
clever lion
#

🤔

#

I'm a bit confused

#

but how do I know domain name?

astral wave
# clever lion but how do I know domain name?

I mean.... you will need to put it somewhere to be accessed am I right. While testing webgl you can use locallost. While testing on editor you can write full path on your pc. like C://path/mp4

clever lion
#

so... there's no persistent path between editor/local server/and web server?

astral wave
#

On all platforms except webgl and android there is. Workaround is to get domain from Javascript on start.

sly wave
#

Hi. I'm currently try to reload a scene which has many GLB objects inside loaded using a web request. But the memory is never released by unity if I destroy the object or reload the entire scene. Anyone has a suggestion? Basically the Garbage Collector doesn't work and if I reload many times it goes out of memory. Thank you

quartz knoll
#

I tried setting the resolution to 1920x1080, but the resolution still gets overridden. How do I fix this?

keen urchin
quartz knoll
#

I had to switch my canvas scaler mode to this and that fixed it

#

Then it won't scale it weirdly

#

Though this gives an issue with positions not being aligned as they should be which is also interesting

quartz knoll
keen urchin
quartz knoll
#

And how would I go about fixing the anchor point problem

keen urchin
#

And confirms that it's a scaling setting or anchor point issue
Anchor points determine how canvas elements adjust to scaling

#

But it might be due to something else too

quartz knoll
keen urchin
#

which then usually adjusts to different device resolutions automatically

quartz knoll
#

Free Aspect does give the same issue, though in the build it appears to just be 1920x1080

quartz knoll
#

It does say it's 1920x1080

keen urchin
quartz knoll
#

That's a pain in the bum, and I really have no use for that

#

It does not need to support any other resolution besides 1920x1080

keen urchin
#

Why not?

quartz knoll
#

It's purely a small minigame that will just be embedded into a website, with other stuff in it

#

The game won't be the main focus

#

I also just do not have the time to develop it that way

#

The game is fully finished, the build is just wonky

keen urchin
quartz knoll
keen urchin
#

Scaling is an integral part of UI development, and only really a difficult thing if you don't understand it
It quickly becomes easier once you do

quartz knoll
keen urchin
quartz knoll
# quartz knoll It does say it's 1920x1080

To force a resolution you'd have to hardcode the frame size to the site
Though the thing is that it kinda is already? Since it does say it is 1920x1080, unless I'm misunderstanding something here

keen urchin
quartz knoll
#

Damnit

#

I'll test it on my laptop (1920x1080) and see what that does

quartz knoll
#

So there's something wonky going on the the aspect ratio then

#

Which I don't know how to fix ;-;

#

I'll have to see what happens when I upload it to itch.io or smth

#

Even if it works there though, it'd still be nice to somehow fix

keen urchin
# quartz knoll So there's something wonky going on the the aspect ratio then

The same scaling and anchor settings determine changes for both resolution and aspect ratio
When aspect ratio also changes and not just scale the elements must know if they should squeeze or just move closer/further apart while staying anchored to some relative position of the screen and in what proportion
I recommend practicing it a bit

astral wave
#

To make some things for certain, the resolution you set in build options doesnt matter. It will be rescaled depending on your Canvas size. So you will need edit HTML and CSS to make sure the scaling does not change aspect ratio. As different laptops have different resolution and aspect rations also mobiles and etc.

UItoolkit have way more friendly way of working with UI on web, as it follows same css rules just like webpage. And you can more easily control how it scales. I personally set default aspect ratio and resolution, that put scaling to shrink and control parameter choose either Height or width, then at least I am sure that aspect ratio wont change in weird ways.

Regardless this will require you to work with CSS and HTML first, when you are finished with that, then go with Unity stuff.

outer osprey
#

hi guys, does anyone have any idea how i would use the webgl build with react?

high patrol
outer osprey
high patrol
#

You need to learn React routing then, to create an endpoint /play in which another html source lives that contains that Unity HTML component

outer osprey
#

is it possible to just add the route in my existing html file? and put the script part of the code in there?

#

i dont have any experience with html at all so i'm not sure

outer osprey
hoary imp
#

is it possible to stream a whole scene from network at runtime?
mesh, and texture, lighting
streaming LOD from high to low, little by little

astral wave
# hoary imp is it possible to stream a whole scene from network at runtime? mesh, and textur...

You will need to use different word from stream. You can load assets from network with addressables, you can load it from low to big as it gives you high control over stuff. So I double on DevDunk suggestion.

Or you can go check WebRTC stream unity rendering for actually streaming rendering. But have in mind that does not work with webgl 😄 you can stream to web and stuff, but not webgl 😄
https://github.com/Unity-Technologies/UnityRenderStreaming
https://www.furioos.com/

sinful talon
#

Hi All. I am trying to build one of my unity projects to WebGL. But no matter what I do I have not been successful due to the following errors

#

If I could I would try without using IL2CPP. For desktop mode I have mono as an option for the scripting backend but for HTML5 I only have default

#

I have looked in the forums but can't really find the answer I need

astral wave
sinful talon
#

I believe the second and third errors are caused by the first one

#

This is the second error

#

This is the third

#

everything else is just script warnings

astral wave
#

I am talking about this editor logs, it provides more information about build status with more accurate errors. jsut find build error and check logs that are before error. It is comonly possible to see the file that was beeing compiled there

sinful talon
astral wave
# sinful talon ah ok you want this

You need to copy it after trying building your build. Because here you have somekind of licencing problems which dont rly have anything with build data

astral wave
#

also what version are you using?

sinful talon
#

not in that project

sinful talon
#

ok it turns out the problem with the application is that I had c# scripts that were importing functions from a dll file that had spaces in it. I removed the spaces and it built successfully.

#

I now have another problem when the webgl application tries to call the functions

#

do I need to install emscripten?

chrome smelt
#

Hey there! I'm working with a WebGL build integrated into a Next.js project with React-Unity-WebGL hosted on Vercel with a Supabase backend. I'm curious what best practice would be for hosting the build files (~150mb rn). Vercel is deploying from our Git repo. Technically, I think I could host our build files on Git, but that seems ill-advised given their size. Supabase does provide media storage. I could probably serve the files from there, though I'm not sure how well that would integrate with useUnityContext in the React-Unity-WebGL package. Would be grateful for any insights or to hear solutions others have implemented!

outer osprey
#

Hi guys, I'm having issues with the WebGL build of my game, it works fine when built for mobile and desktop but the WebGL build is extremely buggy. Textures are missing and characters are not doing what they're supposed to

#

Any idea on how I can fix this?

high patrol