#🌐┃web
1 messages · Page 10 of 1
you know how you have to write SceneManager.LoadSceneAsync? Now you can have something await the scene be loaded instead of using the .sceneLoaded action
or you do something for an unspecified amount of time without using a coroutine or checking on an interval amount of time
Probably make sense to ask this problem here than code-beginner channel. The editor mode ran fine without hiccup, but as soon as I build it out, it breaks after a mouse click. Would like to know how I can narrow this problem down?
Really wish I knew where to look into this issue 😦
try disabling the audioplayer?
Hello!
Ive been trying to deploy my app to webgl, all good with performance except when the camera tries to render LOD assets it freezes big time, is there some kind of low performance for WebGL with LOD objects?
I wasnt able to find anything on the web
pfff the web is still constantly changing, it's exhausting trying to find something that will last
RT
does magiconion work with webgl?
Hello everyone, does anyone know how to send a mail with a CSV that I'm gonna generate in run time? Do I have to use MemoryStreams and array bytes instead of files? Sorry if this is unclear.
Just the first render? Might be shader compilation.
Yeah, like after taking a good look around the complete map everything works relatively fine
wdym by shader compilation? sorry im new to unity
I'm getting a socket exception in Webgl build and I'm not sure why. Does anyone know what could be causing it? Thanks.
is the string for mail null?
No, I can send it if I build for windows, it works just fine but in webgl it throws an error
I'm trying to connect to sendgrid, a service to send emails
I found this. I'm not sure how to proceed then...
So I need my own server otherwise is impossible, apparently.
Pretty sure Sendgrid offers a web API
Mmm this seems a bit advanced for me, I have pretty much zero experience with networking, I'm a bit confused. Sadly this is something that needs to be done rather quickly so I'll try to follow you guys advice but at the moment I'm still a bit lost.
Yes Andrew and thanks for the help in advance.
Would I have to have a local server (in case I don't want to pay for a service) running and connect to that server, and the server would have to handle the connection to the sendgrid API with all the information to send the POST ?
Sorry if I'm using the wrong words for things, if so please correct me.
I was gonna say if you didn't have an SMTP server inside the webgl build running or are connected to a local one via websocket it's not going to work
I would recommend building out 2 separate applications
Use the signalR RPC to call a function on the server side from the webgl side, and then have that server actually connect to the SMTP server
I mean, it just sounds like too much of a pain in the ass to do, I'd rather use signalR
You're also limited to single threading in webgl
I appreciate your help guys, this is still a lot to take in and I'm gonna go into a study frenzy with all the info you're giving me because I simply don't quite understand it all yet. But at least the actions to take are clear in my head. I just have to understand the know-how now.
Thank you, really appreciate your help here.
take a look at that Unity-WebGL-SignalR repo and see if you can get the webgl client talking with the server -- you shouldn't have to make any changes, just run it
Once you have it running, you should be able to take the SMTP related stuff and put that in a new RPC and the server should be able to connect to the mail server
when i try to put unity webgl games on github it keeps saying theres a error
its not for every unity webgl game
just the actual good ones
not 100% sure if this is what it says on pc
do i need to add any extra files?
cause this was the only stuff i had on it
well they probably figured since they already target both android and ios directly what's the point
if you're having trouble with that Unity-WebGL-SignalR repo's powershell script, try copying the folder to a shorter directory length, mine went over the 255 char limit
I just said its the same on pc
So this same build doesn't work for a normal desktop browser?
doesnt work
on pc either
what are the errors
read it
in the console, I'm assuming there are more
wym
its only
on github
anywhere else
it works
buy
but
i need it to be on github
in the browser hit f12, what does the browser console say
oh shoot
thats the html
Hey, good evening everyone, a bit of context: I have been doing the Unity Essentials Pathway lately (not new new to Unity, but wanted to get the gears rolling again, and decided to start from scratch) and all has been sweet and well, until... Two days ago. After publishing the Real-time audio Moving Sound Challenge as WebGL on the play.unity platform, it got stuck loading on 90%. Okay, I thought I had done something wrong, so I tried to create a new project without the URP template, and add the extra stuff via the package manager incrementaly, yeah got the same outcome. All cool. It was just one of them not working. Carried on doing the assignments, the pachinko one of the real-time 2D is working fine. Then... I tried to play the Karting Microgame build I had already submitted and was working properly, and this happened (see the annexed image). Went to check on The Floor is Lava assingment that was also working properly before, and it isn't also loading... So basicaly, since that... Bug or whatever (I am clueless about it). 2 other builds that were working properly, just decided to give up on me. Which makes 3 out of the 8 uploaded. Some of them were just to track progress and to test it out, no big deal. Just wanted to know if this can be a bigger issue than that... Will carry on progressing on the learn.unity platform, and thanks so much for the great tutorials out there. You guys are awesome!
im trying to install the webgl module for unity 2020.3.27 and it says i cannot because "Apple cannot verify the intergity of these files, they need to be updated" Im not sure what i am supposed to do should i upgrade the version?
Hey so I've just been using webgl for the first time to upload my first game jam game, and I've received this error when trying to load the game on itch.io
I don't really know what to do about this
So any help would be greatly appreciated
Considering that the jam is over at 6:00 am tomorrow I need to submit this soon
This seems to be the error
That is the only one in the developer console
I still have no idea what to do
Nevermind I fixed it
my webgl project keep going out of memory on startup. it is quite a sizeable project so i am not suprised. unfortunately i cant seem to find a fix. any1 got ideas?
found the issue. Video and AudioFiles seem to be the evil-doer here
what was ur fix?
I just had to make the project decompress on load, it was in my player settings
that is true, however i believe it does take longer to load.
i'm trying to build a game for webgl but half of the game is broken and i keep getting these messages
I think your script is somehow disconnected with your objects
In the script, your file and name class must have the same name
like if your file name is oofers.cs then class definition must be public class oofers: MonoBehaviour
it works fine in editor. the webgl build has this error
Can't even get my webgl build to load so I can't help you there
Is there a grass shader work on webgl?
is there anyone who has faced this issue before.
I have multiple audiofiles in my scene. now it has come to my understanding that unity WebGL doesnt like them (straight up goes out of memory.)
is there any way i can load them seperately?
Hello guys, I have question. How do I set the react Transform to auto arrange? when everything is setup in full screen, some of the button I placed is in different area when in windowed mode.
See the screenshot
Prob solve
Hi, looking for some advises. Anyone knows how to share on instagram in webgl ? or if it's possible at least (without other server-side script) ? Thank you
Btw just wanted to say for what it matters, two of the 3 non working builds are currently running atm. Dunno what kinda magic happened but thanks a lot
hey i'm new to unity, will this https://assetstore.unity.com/packages/tools/input-management/joystick-pack-107631#reviews working on webgl for mobile? i just read that unity doesn't officially support webgl mobile yet
Using VideoPlayer to play an mp4 video in 2021.2.12 on WebGL 2.0 in latest Chrome/Firefox/Edge is resulting in stuttering due to poor framerate. GPU (3080RTX) in chrome inspector is using 44ms per frame during playback resulting in dropped frames.
Anyone else noticed this? Any fixes?
Seems to be Linear rendering that's causing the problem if anyone cares. Switched to gamma at that fixed it.
Anyone can help me with optimization for webgl? Especially with memory consumption when running webgl on ios devices. Like when I run on androind or browser takes around 150mb and ios taking 850mb. Its too high...
heyo!
how can i go about debugging my particle system that doesn’t show in webgl build? i understand unity + webgl is a bit buggy due to lack of proper support but i know particle systems can work in webgl. what should i be making sure i do/don’t do?
also, my trail renderers only work half the time (at first but then stops working later).
would be super grateful for some help as this project needs to be deployed to webgl.
thanks for any of your time❤️
oh and please tag me or DM me if you wish to help out
Unity doesn't support mobile web browsers
can we pin that?
this is kinda specific but does anyone know how to get unity games working with node express? i'm already using the compression middleware but some games aren't working
disabling compression is not an option
Well, considering that Unity recently removed the unsupported on mobile popup from builds and other recent changes, I don't think that would age well short term.
Thanks! But even if unity removed this, is still possible to run webgl build on the mobile browser. So there is anyway to optimization for webgl that we dont need to compress the textures. I tried the code stripping but no changes at all... I just dont want to move to playcanvas or other engine.
How do I get my WebGL build to work in production with my website? Where am I supposed to deploy my WebGL build files?
hey anyone knows why this happening? when i'm testing my game inside of Unity it ran without no problem, But when i build the game and run it, the game wont display texts
this is how it should display (also this screenshot is from unity, not the build)
I am struggling with an issue on mobile (webGL). Apparently there is a limit on resolution. when I run the page with the meta viewport at scale 1 then it runs fine, but my site has a viewport scale of 0.4 and that breaks the build on all phones with a million errors like:
[.WebGL-0x21176e200]GL ERROR :GL_INVALID_VALUE : glTexStorage2D: dimensions out of range
I've tried tricking it to render at lower resolution and stretch but no success. like for example rendering it at half resolution and then using CSS transform to scale up the canvas again.... but that turns out it is the same as just setting it full size again.
anyone had to fight this before?
That's the issue, if it's not officially supported then you all are pioneers for that platform. The amount of support and docs for doing webgl on mobile will be very sparse -- in a platform where docs and support are already pretty sparse
Can anyone help me with WebGL text field input and Japanese text? Before that I found plugin which creates HTML input on top of an input element for that. As otherwise there would be no IME support. But I moved to UI toolkit.... and Now I am lost 😭
playerprefs values in webgl build are hackerable?
So how it is possible to have WebGL chinese or Japanese game.. if in order to have chat, you need to have all kanji... it is over 23000... And in order to have it working in WebGL and TMP or UI toolkit, you need to build font asset.... And 13000 of kanji is only.... 36mb :DDDDDDD
got it! thanks 🙂 One thing that helped to reduce was using addressables. I am still doing tests, but they look good.
2021.2 changes: https://forum.unity.com/threads/new-for-webgl-in-unity-2021-2.1234180/
2022.1 beta changes: https://forum.unity.com/threads/new-for-webgl-in-unity-2022-1-beta.1234720/
can someone tell me why I have these errors after uploading a project to play.unity (upload going well) ?
[UnityCache] 'https://play-static.unity.com/20220304/webgl/8953eb8c-7dcb-4fcb-8ec1-3420bf152643/Build/' request failed with status: 404 Not Found
Unable to load file https://play-static.unity.com/20220304/webgl/8953eb8c-7dcb-4fcb-8ec1-3420bf152643/Build/! Check that the file exists on the remote server.
ah okay, i was using TMP that i downloaded from a project, ill change it to default text. see if this works
hello all, i have this errors on webgl export, not found on google
Unity 2021.2.14f1 URP
can you help me?
ok fixed by upgrading to 2022 but this is not a fix 😐
ive been trying to make a webgl build for a game on unity 2021.2.14 and no matter what i do it just wont work. ive created fresh new testing projects in this unity version and even then cant build with webgl, but i can still build on older 2020 versions of unity.
i have the webgl module installed for 2021.2.14, but i always get this error midway through building to webgl
the errors generally have something to do with a library/bee/artifacts folder
I have an issue with my WEBGL build. When it first starts, the graphics are super pixelated like this:
But then when I go in fullscreen, the graphics look correct
This also works the reverse way. If I force the game to start in fullscreen, it will be pixelated. But then when I minimize it back to windowed mode, it looks fine. It's like the graphics aren't being loaded properly at first, and just need a "screen refresh" or something. Any ideas?
NVM, Fixed it! Had to delete "QualitySettings.vSyncCount = 0;" Apparently WEBGL builds don't like this
What does WebGL like tho >.>
build in webgl running on windows rigidbody moves smoothly, on mac jitter a lot
anything i should know to fix it?
ok, I found the problem is with apple M1
CSRF question:
Unity documentation states that:
In addition to the above, the following headers are filled by the web browser on the WebGL platform, and therefore may not have custom values set: cookie, cookie2, user-agent.
How I can set cookie and xsrf Token?
My current code so setup webrequest
UnityWebRequest webRequest = new UnityWebRequest(url, "POST") {
uploadHandler = (UploadHandler)new UploadHandlerRaw(Encoding.UTF8.GetBytes(bodyJSON)),
downloadHandler = (DownloadHandler)new DownloadHandlerBuffer()
};
webRequest.SetRequestHeader(XSRF_TOKEN_SPRING_NAME, xsrfToken);
webRequest.SetRequestHeader("cookie", "XSRF-TOKEN=" + xsrfToken); //<---- This gives error.
webRequest.SetRequestHeader("Content-Type", "application/json");
return webRequest;
Unity states that cookie header is handled automaticly, but in my webrequest header there is nothing.
:method: POST
:path: ******/*******/******
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en,ja;q=0.9,en-US;q=0.8
content-length: 29
content-type: application/json
origin: https://********************
referer: https://********************
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Unity 2021.2.10
What I get as result is: "status":403,"error":"Forbidden",. Aka you dont have token cookie go away.... But I cant set it, and it does not set automaticly
Finally got unity websocket communication working with the jslib unmanaged stuff
getting this when testing a webGL version of the game. its going to be an exe but our video editor is on mac and he needs a build so tried sending webGL version. is there a fix for this? or will I have to navigate him through making a build.
Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.
Well.... What kind of application it is? Well obvious solution would be optimizing your build. Compressing textures and etc. stripping code. Depending on your Unity version options stands in different part. I really dont know if it is because the quality is suer high, or there is memory leak, but most likely everyone will be happier if you would just send him build for his platform..... If webgl is running out of memory then it is uses at least 4gb of RAM. Anyways then even if it will run, the user will have more pleasant moment with build for his platform.
Check the WebGL settings in the actual browser JS. You can set the memory to adaptable and/or request a specific memory size which reduces the chances of a memory overflow.
But it could also be a memory leak in the code.
WebGL does garbage collection very different from desktop and editor builds.
Is it easy to host Unity WebGL on a server running Windows CE with apache as web server?
will unity ever support building webgl on linux?
WebGL is driven browser side. If you get apache running on CE, no reason why not. But I'd use Ubuntu or something more web friendly.
I'd ask that one on the forums.
Do they not currently? Do you mean Unity being able to compile a webgl build on linux? Or a linux browser being able to load a webgl build? Web browsers on linux should support a webgl player (phones can play them...what are phones based on....)
He said building of the web player itself on Linux. Iirc it's been broken for a long time
There's some talk in the issuetracker about compression, can you build a webgl app with the "development build" option checked?
Maybe that's why they changed to start using that weird new compression format brotli (.br). They claim it is fixed in 2020.2.X
Hello,
I want to ask them in unity some event that will trigger as soon as I call from index.html unityInstance.SetFullscreen (1)?
Hi,
I am working on a game/app, and in-app-purchases (IAP) is required.
IAP doesn’t work for WebGL. Is there any other way to make in app purchases another way?
Thanks :)
You'd have to integrate a payment system like PayPal or something, have your own database that saves who has bought what, and of course user accounts. And be prepared to handle support for refunds and technical problems and such. GL
Also a BaaS like playfab can help you a lot to get started
Xsolla was pretty popular with .io games.
Thanks I’ll look into those :)
Yeah right now I'm trying to get websockets working through a javascript jslib plugin so that the webgl build sends requests to a server that handles them (could do IAP type things as well down the line)
hi, im trying a webgl build for the first time and im having the weirdest issue, seems to be on native c# level, and its code that runs just fine on all the other platforms (ios, android, windows, mac, nintendo switch), here's the code: https://pastebin.com/P0Q0WnFs, and here's the error: https://pastebin.com/UW64mtft, the K generic parameter is an int, and its fine when its value is 0, but for all non-zero values im getting these 'out of bounds' exceptions, on both TryGetValue and ContainsKey calls
ive already tried disabling 'strip engine code' in case if was that, and even rewritten it without the use of generics, but it keeps happening the same way
nevermind, case solved, no multithreading support, RIP
i get this error when i press any button on keyboard,it happens only once,then i can play normally.can anyone help?
Hallo, anyone uses this plugin and knows how to get it to work on WebGL? https://assetstore.unity.com/packages/tools/integration/qr-code-barcode-scanner-and-generator-cross-platform-pro-56083
Does Unity cross compile the volatile keyword in IL2CPP for webgl?
which should I choose?
I want code that is runned only in webgl build
PLATFORM_WEBGL or UNITY_WEBGL
#if UNITY_WEBGL && !UNITY_EDITOR
can anybody help me with this ??
oh, thanks. Do you know what is the difference between PLATFORM_ and UNITY_ ?
Anyone know why, if I make a webgl build with unity cloud build, my lighting is darker than if I build natively on my machine?
just having this cathastrophy when I tried to export to webgl
it working just find during .exe
all of those errors are not quiet shows up with .exe build (on editor)
if anyone could help me I would really appreaciated and buy him a coffee
Show the earlier errors, since most of the errors on screen are just generic errors because of previous errors.
it's done with reinstall
Hi guys. I have a following problem. I'm doing a WebGL app and I'm trying to merge webgl app downloading screen as similar as possible to scene loading screen in my app. Despite using the same Arial font, it is looking a little bit different (especially the percentage sign). How can I make it better? The results I have now:
As you can see the percentage sign in the bottom (when the app is running and scenes are loading) is lower and wider
Arial font is a built-in font in Unity right? It is also available in the webgl build?
50% is done download the webgl app and 50-100% is done when scenes are loading in the unity app. Video:
so URP SRP now supported on webgl ?
why some of my login button are broken on webgl,
since it work just fine on the playmode
Yes, URP is supported on WebGL.
Sir any chance for me to fix why some button are broken on webgl ?
it's just inactive and there are no error message on it
well there is one, but the error seems not related
Socket error is network related, and your button is likely relying on networking. I don't think KCP transport supports WebSocket. You should switch to the WebSocket transport.
So I build and run a WebGL build and I wonder what make this webgl take so many Memory. So I went to Task Manager to check and see these first three in my browser. Can someone tell me what does those doing. I can guess the high GPU one is doing graphic and stuff. The Unity WebGL Player contains asset data. But what does the first one do and why it takes so much Memory. Hope someone can enlighten me.
Anyway I also get the Memory Profile Snapshot.
tbh I really have no idea how to set it up,
recently I just tried the multiplex transport on my network manager,
to replace KCP
turns out I configure it wrong
Multiplex transport enables the use of multiple transports. It doesn't replace any specific transport. You can get more help with this on the Mirror discord server. Link is pinned in #archived-networking
thanks danny
but how about the web server IP address ?
currently I'm using WebGL Publish from package manager and it goes to Unity Cloud
That package is specifically for easy deployment to Unity's system. Build the WebGL just like for any other platform.
yes Sir, I'm gonna go localhost atm
hey guys
when you build for webgl does it build the webserver and eveything or?
only the concent
DO you have to wrap webGL orojects that use AR in a service of some sort?
It launches a webserver for you when you use Build and Run, otherwise it just builds the site and content, which should be hostable on any webserver.
I didn't know this and have been using build and webserver for chrome. Very cool. Thanks
firebase
My game is running much more slowly in WebGL than in the Unity editor. What can I do? I looked at the Unity manual (https://docs.unity3d.com/2021.2/Documentation/Manual/webgl-performance.html), where the advice is:
For best performance, set the optimization level to Faster in the Build Player window, and set Exception support to None in the Player settings for WebGL by expanding Other Settings > Stack Trace.
How do I get to the "Build Player" window? Does that mean the "Build Settings" window? If so, the options for "Code Optimization" are "Speed" and "Size", while the options for "IL2CPP Code Generation" are "Faster runtime" and "Faster (smaller) builds". I did set Exception support to None in Project Settings -> Player, but it didn't seem to help.
Is Unity's WebGL support just ... broken beyond usability?
I've built a lot of WebGL projects - separate and embedded. You need to optimize your projects for WebGL to make it effective
It has graphic limitations, browser limitations, higher polygon limits, restricted rendering techniques. And handles things like garbage collection differently. Most games need proper focus on WebGL for support.
Is it fair to say that building a WebGL game is much harder than building for Windows or MacOS?
I'm having an issue right now where the TopDown engine, freshly installed, crawls in the demo scenes in my WebGL build. It doesn't have that problem when the creator builds it, but I'm literally not changing it. I have no idea where to begin diagnosing this.
It's about onpar with mobile. But a tad tricky due to the way it handles garbage collection. Some UI settings also run bad on WebGL...
When we do pure WebGL games we don't use unity. But I think it's about as complex as learning android runtime stuff be and xcode for mobile...
It's definitely not as forgiving imo!
It's been a long time since I debugged WebGL, it was quite tricky to do...
It is quite frustrating when it doesn't play nice
Well, it's good to know it's not just me. I'm not sure how hard I should try. I'd prefer web for my project (fewer installs == more players, and I'm not in this one for the money), but maybe I should just give up and go with Windows / MacOS.
Is there a good resource on getting Unity games to work in WebGL, or is it "get three years of experience"?
This may help at times but it's a lot of logging mostly...
The biggest thing is it doesn't release ram until it finishes all scripts on a frame. So LinQ etc can create a lot of temporary garbage that makes it chug slow
That goes into the memory challenge in more detail...
I mostly rely on the Firefox / chrome profilers
And once in a blue moon use renderdoc
For webgl debugging
Thanks. Yes, it is very frustrating. The Unity marketing talks as if the platform takes technical problems out of your way. When my game runs within the Unity editor, it feels like I should just be able to make a WebGL build and put it up on itch. Instead, there are endless rabbit holes of configuration to get even the simplest things to work. Grr.
If I could read a book on how to do this, I would, but the knowledge seems to be scattered across a thousand tiny web pages.
I tried the advice at https://www.youtube.com/watch?v=HYSA8D8uSdE, but it didn't help. It got my build down from 31.1 mb to 25.9. Is that unreasonably large? The graphics look smooth, but it takes a large fraction of a second to respond to a keypress.
play this game here! https://spekwork.itch.io/friend-tube/download/zM8gB28_bQPH8v_nvRf1SeCy_rQRrKLaeZS35Ds9
Watch us dev digital art live here: twitch.tv/spekwork
join the ArtCADE discord to connect with other digital media artists: https://discord.gg/r2Qw8Y3
Find out how to find which assets are bogging down your WebGL builds from Unity, and...
You have to figure out how to optimize your builds regardless of platform to hit lower end devices and to author larger amounts of content in general. Unity can't magically bridge the gap moving from a desktop with 8 to 32 threads with the latest tech in rendering to a security sandbox with one thread and a 10 year old graphics API.
Also if your configuration issues include the compression/header stuff, Itch.io has part responsibility on that. Using latest web compression is a reasonable default imo.
That's the thing, though -- I'm not trying to do anything high-end. My assets are all very low-poly. It runs smoothly in the editor, Mac and Windows builds work fine, but on WebGL it's a slideshow. Even weirder, I get this problem when I run someone else's scene unaltered, but they don't. I'm frustrated because I've tried every lead I can find and nothing helps.
Hey! Does someone knows if Light Layers work with a webgl build? it works well inside unity but when running the webgl the layers just dont appear to work (as if they were not present at all)
What browser are you using? Try clean installation of Chrome. Plugins can severely impact performance of the site content.
Firefox. I don't think it's the browser, because the developer's own build works.
I made a fresh project and this time it works. It may be a very picky interaction between versions of Unity and versions of the TopDown engine (needing a newer version of TDE but not the newest version of Unity). Continuing to explore...
Is it possible to update the WebGL build on the Unity Play website for a game submitted to a past showcase? My game (Oscillarium) got featured on the January 2022 showcase, leading to a lot more people than I expected playing it, and I recently discovered that some people are running into the infamous "stuck loading at 90%" error. I was able to repro this error myself in Microsoft Edge and Firefox, but Chrome works fine, at least for me. In any case, I think I have fixed the error (by disabling build compression) but I don't see any way to upload the changes. The Post icon in the top right of the Unity Play page submits a new game and trying to publish from within the editor results in: "Something went wrong HTTP/1.1 500 Internal Server Error". I haven't been able to find anything about this on the forums or documentation or nothing I can see in the showcase rules confirms or denies whether post-showcase updates are allowed.
Try using one of the many JSLib implementations. https://github.com/jirihybek/unity-websocket-webgl has one that works. Or you can make your own https://docs.unity3d.com/Packages/com.unity.industrial.forma@3.0/manual/forma-js-api-devGuide.html https://javascript.info/websocket I would recommend using websocketsharp's WebSocketServer for the server side. They have good documentation in the code. https://github.com/sta/websocket-sharp
The JSLib will be dependent on whatever websocket library your node.js server uses. Mine (and probably yours) uses sock.js
It's especially difficult since webgl doesn't have a debugger. Gotta Debug.Log everything to find your issue. If someone could create a debugger that somehow worked with a browser and stopped at breakpoints in visual studio they'd make a fortune
I have essential question here
how to access my output webgl data
because I've done my webgl build and it contains with TemplateData, Build, index.html
in default unity will opens a browser page after build processing
but when try to move those builds to htdocs
index.html just won't run
most browsers will run into issues running a webgl build from the index.html file. You have to enable stuff in each browser to get it to work...or throw the contents of the build folder into a node.js webserver and connect to a React webpage that hosts the webgl build
Hi, I'm getting an index out of bounds error and I dont really know why. It occurs when I shoot a certain objects/enemies/things with collision with my players projectile
It only occurs on browser. development unity hub works fine.
i can provide some code if necessary.
Could it be possible that this is caused by my bullets which create an animation whenever they break?
It's weird since my game was working on browser before and now a couple hours of working later and deploying it broke.. I didnt add any crazy things or change anything to the things which cause it to break (shooting things)..
Hmmm... Seems to have been because of the animation I play on my bullet whenever it destroys itself. I didnt think i'd solve it so quickly. Would anyone know why this is happening? This error didnt happen to me before.
I didn't notice somobody replied, but thanksss BAR let me try
can we use visual scripting at a project started with 2d core ?
Is anybody else having trouble accessing content on play.unity.com? When I click on a game, I just get a white screen
I can get the homepage, but blank page when clicking on any of the games
Gyah! Now my WebGL project is crawling again, even though I checked out (from git) an older version that used to work fine. I can't find anything that has changed, but what used to work now doesn't.
Solution found! You have to, in the Start method of some script in your scene, do this:
Application.targetFrameRate = 30;
Why is this not the default? The claim at https://docs.unity3d.com/2021.2/Documentation/Manual/webgl-performance.html that "the default value of –1 ... allows the browser to adjust the frame rate for the smoothest animation in the browser’s render loop" is just false.
guys what's this error ? i couldn't find it on gg.
Hi, so I tried to do a WebGL build in OpenXR for the Rift S and I'm getting the "name 'Micropnone' does not exist in current context" error. Is there a simple work-around for this?
What is GG? The error says you are missing shouldBeBlock in your JSON file.
I doubt thats related to the OpenXR plugins. Sounds like some other plugin
Ah! Your right, thanks! It was one of Oculus's plugins.
that's google. But i found how to fix that. thank for your response 😁
I am able to compile now but the last I tried it before work, neither the VR nor the AR button would activate on the Quest 2. I'm only now going to try to debug it...
Strange...It seems to be working now...
Ok, so I'm using De Panther's 'WebGL Exporter' package along with his 'WebXR Interactions' package with the included desert demo. If you haven't already, I would suggest joining the WebXR Discord server. They are the ones that helped along my path. De Panther has a video on how to set it up (not with OpenGL) and I posted a check-list for the video (search for 'check list'). Once you get it working with his process I would then move on to setting it up with OpenGl. I had a lot of trouble setting mine up. It turned out I need a special .htaccess server side which 'm2' gave me. Best of Luck!
Let me know if you have more questions
By the way, I'm using Unity 2021.1.28f1. Don't use 2021.2, there were issues with it and I don't know if they have been resolved....
I had trouble running my builds on browswers untill m2 from the WebXR Discord server gave me a .htaccess that solved my problem. I'll post it later...
I have a basic react website running on node.js that uses the Unity React component https://github.com/jeffreylanters/react-unity-webgl how are you hosting it?
I'm actually shocked someone created a react project for that, you can literally send messages to WebGL unity packages with a single line of JavaScript. I get it's for embedding just... Never thought it needed a repo
Not that there is anything wrong with that, it's just surprising.
I will say though, Unity is not the platform I'd pick for WebXR.
Straight Unity 2021.1.28 build with De Panther's WebGL Exporter
He has a video on YouTube for setting it up. Also, the guys on the WebGL Discord server helped out quite a bit...
Myself, I didn't choose Unity to do WebXR, I chose WebXR to demonstrate my Unity VR work for my portfolio.
Yah, WebXR is NOT performant in Unity...
That's a good reason, going in with eyes open and wanting to is reason enough! :). I forget that folx need portfolios etc, and it's a smart use of it if I may say so.
Thanks!
Hi guys! my UWP project is failing to build to WebGL. Any1 got any ideas? Its a very small game:
It shows you in the log you have unsupported shaders for webgl
Any idea where i can disable them?
Google is your friend.
Okay interessting! thanks
Hi - is there a way to build a game so that I could upload it as a browser extension? I'm trying to publish a game to the chrome web store but I can't seem to find out how
hello
I am trying to do the build thing
but I am getting this error
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <294703faec74477f8b275446429fba82>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <294703faec74477f8b275446429fba82>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
I chose the Assets/Scenes folder
I was watching a video and the guy chose the Build Folder which I don't have, I tried creating one but still didn't work
Hey, I have some problems with reuploading a build to my server, it has to do something with caching I guess? Because the build will run in private mode, but will throw this when simply refreshing the page in normal mode
exception thrown: TypeError: Cannot read properties of undefined (reading 'apply'),TypeError: Cannot read properties of undefined (reading 'apply')
choose a folder outside the directory of your project
where is your calc2project located? where is the build folder you're outputting to?
Calc2Project folder is in the Desktop
I created a new Folder in the Desktop called myBuild
Ok, try another folder called mybuild2 in the desktop and see if that works
@high patrol cough
sorry been workin on shit
yeah something's wrong with that folder. Is that temp folder that unity makes still in the project directory?
try copying the project to an empty folder, but only copy over the assets, packages, and project settings folders
then open it in unity
Chrome Apps aren't a thing anymore, right? I don't think there is a easy way to turn full web page into an extension without just creating an extension that just links to the page.
Hm, alr, I’ll try that instead
sorry went to sleep
this one?
get rid of whatever that cloud backup software is or whatever is making that folder and the green check marks
hey, how hard is it make a save/load system that works in webGL?
the one I'm currently using in my game works on windows builds, but as I understand it, webGL doesnt have access to the computers file system
PlayerPrefs.?
no, using a binary file
it was more of a statement sorry
I meant PlayerPrefs works but it uses IndexedDB
not really into that idea
ok, so how would YOU store a binary file on web ?
I remember seeing something about a free hosting service that is specifically for this sort of thing, but I cant find that guide again
oh well I don't know that way, You can store it on remote server but call some php from unity only did it with a text file so far though
By the way, since the original files are from my Team Mate I told him to try to build from his laptop. It worked!
you can use the Resources folder in webgl
Yes
this is a deep cut - do any of you have context on making a modern / mobile responsive website in unity webGL?
my girlfriend's music label wants me to make her website and i am technically a web developer (in that i teach web development for a living), but anyone who has ever made a website knows that creating anything cool with CSS is like trying to arouse an ancient fossil.
ultimately i will probably just do it the old fashioned way..
but i code entirely in unity, and i would waay prefer to work in that world if it is a possibility. 🤔
If I use unity for webgl, it's only as a plugin system, never for the main site. I'd be a lot more likely to build it in BabylonJS though with a react or angular outer.
No reason you couldn't, but Unity UI is cumbersome.
I would really look into dedicated web engines for something that is less of a game and more part of the site. PlayCanvas has a neat editor for that Unity like workflow, but going even lower level with ThreeJS and Babylon is probably even better when it comes to the runtime. Do some quick early testing with these and make sure to include mobile devices.
Having major issues with a WebGL build
Camera is extremely zoomed in, has weird tearing issues
and this is the size it SHOULD be.
I think it's resizing somehow
But I don't know if that would explain the weird visual glitch above>
Hi I have a problem with my spell_prefab on the Web_GL build i click with left-mouse and my spell does get instantiated in the editor and the WindowsBuild but not on the Web_GL Build, does someone know what to do ?
and it seams like this is the only problem i have on the Web_GL build everything else is working fine.
And i do not get any debug logs, I do not know what to do xD
It's very possible, I made one using React inside Node.js. I just have to copy over the build folder output from Unity and it runs just as expected on Android and desktop browsers
iPhone it's kinda hit or miss, so I wouldn't plan on deploying that route for iPhone
also you'll have to find a style (% of screen) for the Unity component that fits sizing for desktop and mobile
and then fiddle with the canvas scalar to make sure that it resizes how you want it to
but from there all you have to do is throw the react site on a server and open up ports. Don't do anything that requires security. Unity uses old versions of .NET so that's a pretty obvious security issue--even though it might be cross compiled to wasm, I still wouldn't feel safe
is it using a video player? what components are in the spell prefab?
I did find the bug a hour ago, i forgot to write it down here, sorry.
My Spell is an SO which does all the stuff my spell should do.
I did delay my spell instantiation, as long as the castTime is.
The bug was in the delay code, cuz it is an SO you can not use coroutines so I wrote an async function with this content: await Task.Delay(int)
This does not work cuz WebGL is single threaded and Task.Delay creates an parallel thread:
So it did throw an error but just in the console and not in the deployment build .
My solution is:
var timer = AbilityStatsManager.CastTime;
while (timer > 0)
{
timer -= Time.deltaTime;
await Task.Yield();
}
Still thanks for answering my question 😄
UniTask will work in webgl
i want webGPU player already 😢
if you want to do UI in Unity, the right way, you'll be using something very similar to CSS. and there are not many projects that import css frameworks to Unity's USS (you can do it yourself if you know how to transform to USS). UI development in Unity's old UI system is a pain in the ass and a commercial website is basically 100% UI development. Also the player is not native JS & HTML, and was not invented for website rendering at all
I just want multithreading in webgl :<
Got a webgl player embedded in an angular site today
guys this code GUIUtility.systemCopyBuffer didn't work in webgl. does anyone know copy/paste on webgl ? i've searched on google but it just for inputfeld not for button copy.
hey guys.. does anybody able to run WebGL2 builds with latest Unity 2020, on M1 Mac and Safari? All I am getting is glitchy graphics and no option seems to help?
Hey does anyone know how to fix this?
I have my UI set to Constant Pixel Size and it needs to remain this way to prevent the UI from stretching/squashing pixels and making it look ugly... problem is, if the window is resized, either by fullscreen or by some things like retina display, the UI size gets all junked up
Did it resize or just move? Check your UI anchors
yea I actually just did a bunch of housekeeping on the anchors, hopefully that fixes the position of things
Fyi, you can generally test this in editor by setting your game view to free aspect, undocking it (to avoid screwing up your editor layout) and resizing it around
what I also need to do is write a script that can change the canvas scale ratio depending on the resolution (it has to remain whole numbers, and its set to 2 by default)
but like, if the resolution goes to 1680+, set canvas scale factor to 3, and if its 2560+ set it to 4
any idea how I can do that?
Not sure exactly. You can ask this in #archived-code-general or #💻┃unity-talk since these are general responsive UI/pixel perfect questions
I figured the resolution changes might be happening in the javascript, but I'll look into it
Does anyone know how to fix this or even troubleshoot it? When I build my game with WebGL, one of my inputs straight up doesn't work and only one tweening adjustment just never happens. When I build to windows or play in Unity, these issues NEVER happen. I'm having trouble figuring out what to even google other than "webgl Unity doesn't build correctly", but as you can imagine, that brings up many different issues.
Which input exactly? There are some browser specific considerations with certain inputs. Also make sure it's actually the input not working and not the logic using the input.
Does that particular tween perhaps rely on async/await, is connected to AsyncOperations or relies on undefined ordering to function (for example, subscribing for an event in Start that is also triggred in Start)?
It is just a spacebar using unity's new input system.
I select one of the balls, and then pressing spacebar will do the action. What is strange is that the input works for the middle and right ones, but not the left one. All three have the same exact script though
The tween is using DoTween and it does not rely on async or await. The tween is adjusting pivot's for a camrect. It does adjust ones that happen in awake (if that is related)
For the logic of the input, the ball is highlighted green "when selected" and it does highlight properly, just the input doesn't go through afterwards (even debug.log)
First up, I wouldn't use constant pixel size, it isn't that setting that's stretching your UI, and it will make your UI tiny on hi res devices.
But that aside, the problem is how you configured your UI panels. The only reason the key won't go to the right spot is it isn't anchored correctly.
I am using constant pixel size because my game has a pixel art style, and if the UI is scalled by anything but whole numbers, it stretches and squashes individual pixels
I have a very specific reason for using constant pixel size
You probably just need to set it (the key) as a left-anchor the same as the other UI element it's near
if I was making a more modern looking game, or one that had a more vector-graphics style look than UI scalling would be perfect
I already solved the problem though
🤷♂️ good :)
There are some JavaScript settings you sometimes need to change to pass the full input system to Unity
I'm wondering if something else JavaScript wise is interfering with the space button for you?
I haven't seen that myself but it could be related :)
made a custom script that changes the UI scale based on screen width. if its 1280-1919 it changes the scale of all my canvas to 2
1920 -2559 = 3
2560+ = 4
etc
also does letter boxes and enforces 16:9 aspect ratio
Thank you, I will give this a try!
Anyone knows how i can fix this Error?
Either you need to fix the mime-type or disable/enable compression in the build settings
I enabled gzip compression
But now i need "content-encoding: gzip"
Thats The Error
Yes you need to enable the mime type then on the web server
@charred briar i already typed (Content-Encoding: deflate, gzip
Accept-Encoding: gzip, deflate) in the .htaccess
Hello guys ! I build my game on webgl and I can run on firefox on my pc by just dragging the index.html to the browser.. but if I transfer the files (zip) to someone and they try to do the same thing this error happens... any idea ? Unity version : 2021.2.16f1
I think you need a site to host the game
But I think this worked before in earlier versions ?
Why should it work in my firefox and not on my friends firefox ?
Maybe? But the error says that the browser can’t host it on its own locally
It might be because of a Firefox setting, or because you have the whole build file. Or maybe because you have unity installed
@full tusk you can host it pretty easily using simmer or itch
Thanks for the help @copper siren
I have a really strange issue when I try to export my project as a webgl application.
The whole scene is completely empty after export. It seems like the player controller and the skybox are the only things that are actually exported.
The same also happens when I export a new project using the same parameters.
This is how my scene looks like in the editor
I have never encountered an issue like this before.
Oh my Unity Version is 2021.2.7f1
This is the build result
It's also the only scene in my build
Unity kind of temp dumps scenes at times during build steps. I've seen it come back empty, the editor freeze or many other things during a build. It usually is a unity version specific bug but usually survives 4-5 build cycles
But empty scenes during a build is normal, staying empty after is a bug
@charred briar Yeah it's really strange. I updated to 2021.3.0f1 and it works now for some reason.... Well... except my visual scripts are not working at all.
The textures are not loading at all and the movement is also gone. Both were done via visual scripts
2021.3.0f1, the 0 means it is the very first 2013.3 release. So it likely has some unfound bugs as well, just as a caution
I know it's an LTS build but just cautioning
Oh ok, it was the most current one if I'm not mistaken though.
It's quite unlikely that this is killing my scripts though, right?
Since all of them just don't work at all 😫
Everything works perfectly fine in the editor.
@charred briar Ok, the scripts also work when switching to a PC build
so it definitely has something to do with webgl
I have no idea whatsoever why this is happening.
Seems like it can't access the textures.
Oh no, could it be possible that it has to do with the fact that those textures are saved in the resources folder?
Resources should be fine on WebGL...
@charred briar It was something really stupid once again... I simply had to reload the nodes... It seems to be working now. Let's see for how long 😄
fingers crossed!
does anyone know how to fix an abort(145) error when I try building my project
or what causes it
Had the same problem, selected the decrompression-fallback option. Think this is a good idea anyway, it includes a js-file to decompress, if something fails. (according to manual)
thank you so much! its working low
but I read on the other side, it does not allow partial loading, when decrompression fallback is enabled, so there seems to be reason why it is turned off by default. but at least it works …
Hi, may I ask is there a way to make a random scratch card game with set amount of each card?
When I export out my project to WebGL, player controllers for movement dont work. Any idea on why? is there something I'm not setting up in the project?
Anyone else having profiler error spam in web console when doing Build and Run with Development Build and Autoconnect Profiler enabled in 2021 LTS ?
yes, you may ask
Yes, you probably want to run that server side though so you can prevent fakes
getting a similar error here on 2021.1.7f1
not sure what other info to share with this, it's all a little confusing to me
so I was trying to upload a game on itch.io, but the product seems to be a blank page
tried to do it on simmer but i got the same problem
anyone knows how to fix?
if you haven't figured it out, there's a big "Run game" button that you gotta press.
if you're asking about the page content, such as a description and all that, you need to make sure that the game's page actually has the "Details" section filled out with what you want
the big run game is my problem, it doesn't work :<
ooh alright, you showed it in the screenshot so i didn't understand
it fine
so, you press the "run game" button and it does that? One issue i've had before is that it needs me to fullscreen then minimise the game to actually see it. But, your game doesn't seem to have that there... so i guess i can't be of any help, sorry
oh its aight
just want to make sure tho
i have to upload the .html file that is in the webgl folder right?
oh, sorry for the late response! You need to upload the entire .ZIP file of your WebGL build, which includes the .html (and all the other folders that are included)
oh makes sense, thanks!
Why video player doesn't work on webgl?
Hello guys i have problem on webgl build which is on 2021.2.19f1. Always give me this error The JavaScript function 'Pointer_stringify(ptrToSomeCString)' is obsoleted and will be removed in a future Unity version. Please call 'UTF8ToString(ptrToSomeCString)' instead. But as you can see i changed with UTF8ToString()
hello
is there anyway to make the 90% loading stuck on browser being fix ?
I've make the compression to disabled on the player settings
but still it happens over and over, it never loads
this keeps happening both on localhost and also uploaded on the cloud
you need to try with another framework
if it's just working fine
then your client package might be the issues
Did you watch the browser inspector ?
Most of the times i find the issue there.
F12 ? how to find out it's specific errors ?
I already set the compression to disable
I just had this problem and this video did the trick: https://www.youtube.com/watch?v=-pfsq5S88Zw
ok let's try to replace the DOM file,
but why he using Buildbox
that video is painful XD
No problem 👍
but does it work if you replace the DOM.js ?
what unity version you use ?
coz the latest one are better
streaming assets you can use, but having to potentially have them ready to go at runtime would mess up load times
you mean WebGPU ?
I'm attempting to run a WebGL build over the local network in Firefox. I've set privacy.file_unique_origin to false in about:config.
I'm getting some mysterious errors in my JavaScript console:
The session file is invalid: TypeError: state.windows[0] is undefined
Error: Can’t find profile directory.
BackgroundUpdate: _reasonsToNotScheduleUpdates: Failed to check for Maintenance Service Registry Key: [Exception... “Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIUpdateProcessor.getServiceRegKeyExists]” nsresult: “0x80004001 (NS_ERROR_NOT_IMPLEMENTED)” location: “JS frame :: resource://gre/modules/BackgroundUpdate.jsm :: _reasonsToNotScheduleUpdates :: line 241” data: no]
Any thoughts?
Can't seem to find a solution anyone's shared in the comments to date, but has anybody successfully hosted a WebGL build using Node/Express without nginx or apache in front of it? I've tried and keep running into issues with GZip. Disabling compression/using fallback works, but shouldn't have to resort to it.
Perhaps someone has a suggestion. I've taken stabs at incorporating compression or express-static-gzip but no success, and thought I'd ask before I keep on banging on it too long. Thanks!
Yes, I don't remember what I needed to do to set it up though, and it's not that interesting to retest to be honest. I know there are dummy templates on GitHub for now it now though
Yeah I've gotten it working
I'm using the react unity component https://www.npmjs.com/package/react-unity-webgl and basically just putting the output of the build folder into a folder inside the node.js project
React Unity WebGL provides an easy solution for embedding Unity WebGL builds in your React application, with two-way communication between your React and Unity application with advanced API's.. Latest version: 8.8.0, last published: a month ago. Start using react-unity-webgl in your project by running npm i react-unity-webgl. There are 6 other...
I think you are supposed to be able to get it to work with compression, but mine is uncompressed
so my build folder has the .data, .framework.js, .loader.js, and .wasm files in it
Also I've discovered that initializers just don't work in webgl (will be reporting it as a bug)
Thanks!
Can def. get it functional w/o compression, but that's not ideal
yeah I'd have to think about who would be responsible for uncompressing it at runtime
maybe that react component has some functionality for that
My test site using angular was also uncompressed
try the unity build and run option and google the browser changes you have to make to run
can you rephrase it more thoroughly ? I find my self difficult to understand
Try the google flag, add --allow-file-access-from-files after the chrome.exe like "chrome.exe --allow-file-access-from-files"
OR use firefox and change the about:config
firefox are done with about:config
now I'm trying Google Chrome
ok so that's the steps, let me give a shot @high patrol
not working on me yet ..
fine on firefox tho
Hello. Ive upgraded my project from 2021.1.28f1 to 2021.3 as suggeted due to another issue, I noticed I get this error when trying to run WebGL builds, though this is also running locally (via https-server) Is this a bug or might I have an issue on my side? I had erroneous materials and that was a stopgap earlier, but those materials have since been deleted or fixed. Sadly this error occours
Running it on a Chromium-based browser (Cause Chromium just crashes)
Hi friends,
I'm planning to develop a simple web based multiplayer game using unity webgl. But I have no idea on how to implement the networking part. I have seen websocket. io and webrtc. Which one is good or is there any better way for this. Should I use a dedicate server?.I am expecting about 50-100 concurrent users without any performance lag. Any advice is welcome.
Have you considered NetCode for GameObjects?
I have seen it. Isn't it still in development phase?
I'll give it a try.Thank u @ashen lark
Out of curiosity,what do devs usually use for multiplayer networking in unity webgl?
Best Wishes c: Hopefully it works over multiple web browser instances
my 2021.3.0 doing his job pretty well
try photon, so you no longer overwhelming with the server side
2021 I've had multiple bugs from Unity, I've been safe using 2020.3
Usually roll their own netcode. Websockets is the transport you should probably use, there are Unity JS "plugins" that you can just map externs within C# to the JavaScript functions. My Node JS build uses Sock.JS for transport. I've had to build my own messaging for a dedicated server/ multi client architecture since the NC for GO's is more of a peer to peer solution (yes I know you can build it to be dedicated but the code is a nightmare to manage compared to something that is actually architected the way I want)
Does 2020.3 happen to have the ICU package not installed/found issue?
Not sure about ICU package--I had an issue with Newtonsoft since they include it now
It was an issue I had with 2021.1, libicu was the library that was "missing" at a system level (which makes me think they might've look for a hard name, ie libicu.so.XYZ) Its meant to help with localization
I haven't seen that one yet haha, I upgraded to 2021 once and had so many issues I just went back lol
UI is super nice, but yeah... Im reverting to 2020.3 for my personal projects
how could you open webgl on chrome ?
plus what if the game are played by common people
did they need to configure the chrome first ?
Do they now actually have a transport that supports WebSockets? This wasn't the case for a long time
If you are just asking in general, no, people don't need to change browser settings in order to play Unity WebGL content. You can try this yourself by playing some production Unity WebGL titles, like thelast.io. A lot of 3D titles on web game portals are also Unity WebGL, and you can always confirm by peeking the browser inspector.
well previous advice was told me to set the chrome:flags configuration
but still won't work on me
does thelast.io have certain tweak for their webgl stuff ?
The default build output should work out of the box
Just note that browsers don't like running files directly from local files for security reasons, since you generally only need to interact with files that are served from a web server
Unity's Build and Run option starts a temporary web server and should open a browser pointing to that local url for testing
i'll noted this Sir thank you very much
Hi all, my web application can't input any thing in input field because unity-canvas. Any idea.
I integrate unity WebGL into my website. So my web can't input any text :((
I want to embed my unity WebGl game into a html page, but i cant seem to figure it out. Does anyone know how i would go about this?
It's a new topic for me so I'm sorry for possibly dumb question: Is it possible to implement/support ASP.NET Blazor technology (server side rendered webpages) in Unity?
There's not much info about it in the interwebs
Dose anyone know why when i press build and publish, no files are saved?
any help would be appreciated
Blazor pages is just an SPA. Yes you can run an SPA that will work with an ASP.NET backend server. For front end, I've tested Unity builds successfully with React and Angular.
I'd recommend just looking at https://github.com/jeffreylanters/react-unity-webgl
Then as far as communication goes to the backend server with the Unity component, use WebSockets. I've tested this works through the Unity component to the back end server running .NET (not with routing controls for the website, just specific data I need)
There isn't a lot of hand-holding tutorials out there, so you will have to be persistent to get it working
There's likely a more proper implementation, but the web framework probably allows you to inject vanilla JS and HTML, which you can just use to dump the Unity template in and get it working.
That's basically how it works yeah--just take the output wasm file and the other files and point the path to where they are on the disk
React will use them magically and work (I dislike front end/js development)
thank you smm
Thanks @high patrol and @sweet oriole! 🙂
do i need unity-webgl-tools.js and microphone.js? Seems they both try to access microphone which leads me to believe unity-webgl-tools.js has all the microphone functionality I need.
Why Webgl build takes up to 15 mins? How to reduce the time... Its really bad for testing.
Anyone have experience with react-unity-webgl (https://www.npmjs.com/package/react-unity-webgl?)
Basically, I try to get data from my API and then send that to my Unity build.
I wasn't sure if I was messing up the context because I have a lot of useEffect React hooks going on -- especially where I chain them.
UseEffect A gets the data from the Api and changes a state variable.
UseEffect B fires when the state variable changes and then sends a message to unity via the Unity.context.send etc
While my Debug from unity works in my console, it doesn't seem to be reaching/printing the Debug in the SpawnEnemies my code!
Hello, I'm experiencing texture / color bleed when moving the camera on my webgl build. Weird thing is that it does not happen when running on browser on my desktop, but only appears on my laptop.
Even weirded, when I try to capture this effect with a screenshot (while moving), it does not appear anymore...
Could that be related to my laptop screen hardware ?
Happy to hear any suggestions
I haven't messed around with actually using React to go back and forth between the react component and the react site. I'd assume it would be similar to how you would pass props or something between components? Anyways I don't need to at the moment since my API is running a websocket server, and my Unity webgl build opens a websocket on its own to the server
Ahhh interesting!
Is that hard to setup?
Bc that could work for me in a convoluted manner lol.
which one? the React inter component communication or the comms directly to the server from the embedded webgl?
ok now if I'm using webgl publish
where should I host my server then ?
depends where most of your customers are located
you don't want to host a game server in India and have all your customers in America or performance will be bad, for example
bro do you remember how to fix the mozilla thing here ?
yes my game was multiplayer
I'm not exactly sure what you were asking, sorry... There is no setting for 'localhost' there because you are the localhost
that is usually 127.0.0.1
but other people won't be able to access that
you need a static internet IP for that, which costs money, sometimes your ISP won't allow it, even if you can afford it
these days, even hosted servers don't give you a static IP for the server unless you pay extra for it. It will be dynamic and the IP will rotate every few hours
that's what I was saying... I don't know where because I don't know your customers
are they all in China? US? Australia? UK? Russia?
you need to buy a hosting server that is located in the country where most of your customers will be from
otherwise = lag
@cloud ermine Are you talking about game server hosting or WebGL build hosting?
Game Server Hosting Sir
and I just trying to upload the client
#archived-networking probably has better recommendations. Vultr at least had high performance compute servers for a reasonable price. No idea if they kept up with new hardware releases though, so checking benchmarks is probably the best way to go.
also means we put seperate both build the server and client correct ?
Yes, server builds are generally different from client builds. Depends on your networking setup.
is their any way to connect any web3 wallet to unity. without moralis or any other thing?
Does anyone know how to embed a unity webgl game onto their own website(not premade website like itch.io)
The same way you embed any other content in the website
Yea the build contains functional index.html file as an example implementation.
how would webGL showcases work on here?
me personally doing good, localhost, uploaded yet
anyway the linux are set to Mono binary, instead of IL2CPP
what makes it any different if my client was WebGL platform
https://docs.unity3d.com/Manual/ScriptingRestrictions.html
All the sections listed here: https://docs.unity3d.com/Manual/webgl-develop.html
For the vast majority of things, it doesn't matter.
idk, but it took 10x longer to build Danny
thanks for the link tho
Yea the pipeline is longer and the emscripten compile step seems to be involved.
I'm gonna try both, but unlucky my 2020 lts don't work properly to build mono backends.
it's just not shows up on the folder, might the building process are interrupted
I have exception: unity.il2cpp.building.builderfailedexception:
after building WebGL . how can I solve it, please?
using 2020.3.32f1 version
is it single player ?
about il2cpp and mono are a bit unpredictable my 2020 works building il2cpp but can't produce mono, while the 2021 are the opposite
Hello, does anybody know if we can get 3D assets from a CDN on a Unity WebGL project during runtime?
Yes. Addressables is the most modern solution to this in Unity, but you can also just download arbitrary files and import them at runtime.
you know how when you export webgl's and if you dont do build and run it doesnt work because build makes it so its just local
Is there a way to reverse engineer a local webgl one because i lost everything on it but i have the one thats just build on google drive can someone please help
yes.
wait I'm confused are you saying you're building webgl with Mono?
wdym?
afaik only IL2CPP can compile webgl
I have 2 build, headless linux and client webgl, yes client with webgl,
but headless linux probably allowed with mono ? @high patrol
oh yeah, linux you can build with mono (I mean mono was built for linux originally haha)
nice
I have been trying to get this webgl build of my game to function like the standalone version of the same, but can't seem to figure out what is causing it not to handle the same. I've tried changing Player> Other settings > Rendering to different options, but no luck, the same for publishing settings (just changed the compression format to disabled). I've been at this for two days now and really need some guidance to figure this out. Thanks ahead of time.
what isn't working about it?
I have a script on some cubes that are supposed to move with the mouse when I click and drag them... they don't in my webgl build, but it seems as if they are being dragged because when I let go of the cube, player 2(a client using the standalone version) sees the cube move.
does it works on the other platform ?
yes
any suggestions?
that's out of my league, but in general my webgl runs pretty decent
which version you are using ?
2021.1
@scarlet garnet Don't post off-topic on the server. This channel nor Unity in particular have no relation to this question.
Google the error, there are a dozen different solutions. One would be to just set a bigger memory reservation in the build settings or in the JavaScript
Unity WebGL Cannot enlarge memory arrays
Hello, In Unity 2019.4.23f1, Application.OpenURL opens in the same tab. I upgraded to 2020 and now it opens in a new tab. Is there a way to open in the same tab in 2020 (or even 2021?). I read in the forums there is a Application.ExternalEval but that is obsolete
For a Application.ExternalEval replacement, see https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html for alternatives.
This stuff is for running JS content from the WebAssembly application, which would allow you to potentially write your own JS replacement to Application.OpenURL if the behaviour of that has changed.
What multiplayer framework are you using? It might not be compatible with webgl
I have a long function that is executed after a scene load and gives me that error in build
in unity editor it goes without problems, it only takes 1/2 minutes
what single function do you have that takes 30 seconds on desktop
Mirror
thanks for the info!
I was going out of memory, my fuctions takes more than 2GB. I reduced the complexity and resolved it
generating mesh function
When testing the application on android in portrait mode, poor image quality. I think it has to do with the scale of the canvas, has anyone encountered this problem and any ideas to solve this?
hello dear SSH wizards: Im running my server on GoogleCloudPlatform and i'm trying to use the certbot to verify my SSL cert for my unity webGL build hosted in my VM.. In the docs it says i must execute:
openssl pkcs12 -export -out cert.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem
but when i do i get this error
Can't open privkey.pem for reading, Permission denied 139756379743424:error:0200100D:system library:fopen:Permission denied:../crypto/bio/bss_file.c:69:fopen('privkey.pe m','r') 139756379743424:error:2006D002:BIO routines:BIO_new_file:system lib:../crypto/bio/bss_file.c:78: unable to load private key
do you guys maybe know if there's a command that can give me the permission for this ?
✨
sudoku
hello, so I have a webGL hosted on itch and within the game there are buttons that redirect the player to a website. For some reasons, those redirects don't work but they do n the normal PC game version. Can anybody help with this?
Hi, could not get answer format i was looking for from google so i will ask here too.
Can unity compete to js frameworks in webgl games, talking about babylon.js or phaser.js
Hey guys, could someone please let me know if web gl supports VFX Graph at all?
VFX Graph requires compute support, which afaik is not present on WebGL at all.
Looks like compute support for WebGL was halted in favor of working on WebGPU https://www.khronos.org/registry/webgl/specs/latest/2.0-compute/
I think the biggest web competitor is PlayCanvas, but it depends on how you measure. None of the web focused engines come anywhere close the amount of features or ecosystem of any of the major engines, but their platform support and efficiency tends to be way better, which is essentially true for any platform specific engine.
Thank you so much!
Hello everyone is there a way I can make my unity web game work great on mobile?
Nope, it's not even officially supported on mobile, though some devices may be able to load and run it.
https://docs.unity3d.com/Manual/webgl-browsercompatibility.html
thank you for the quick answer, do you know any other engine i can try out if my focus is web mobile? @frank lynx
PlayCanvas I believe, and it has an editor which mimics Unity in some ways.
thanks alot
Gamemaker studio if its only 2d
yeah it's 2D
really thought gameMaker was free
you need to buy webgl export seperately
oh wow, thanks
While not sure about great, worth noting that mobile support has been a major area in the recent Unity versions. Evaluating latest tech release might be worthwhile.
If you specifically target mobile, then yea, using more purpose built web engines is probably a good idea anyway for performance reasons.
Ok. Thanks
hello, anyone knows if its possible to make a drag n drop files into a webgl?
bro how you finally solved ?
Manage your memory better (garbage collection is different on WebGL) and change the settings it literally tells you to change in the error message.
not sure which settings on the Player Settings
let me google it realquick
Sure you can overlay the WebGL with JavaScript, and send it from JS to the canvas. So no reason you couldn't do drag and drop of anything
go to the build folder, open the .framework.js file, find MIN_TOTAL_MEMORY= and change the value to something greater like a gigabyte keep in mind the heap max value is 2gb
or you could try this https://blog.kongregate.com/managing-game-loading-memory-in-webgl-with-unity/
man thank you very much for this
I really appreciate it
but I have a situation here, since my framework won't show it's editor log on console for the
the assets list, how much and big assets usages on the scene
do you think a texture are loads bigger than a mesh (vertrex/edge/poly)
or it's pretty much the same ?
go to window>analysis>profilers, run the game and see the profiler tabs
let me do
Hey, can anyone help me out?
My webgl build always use the same template although I've changed it in the build settings.
But the result is always like this (Always shows the default template)
Okay, it's caused by the browser cache.
@river merlin always test your site in Incognito (private) modus. And make sure you only have 1 private tab open.
Guys I am wondering how you test a WebGL 2.0 on iOS without having an iPhone. I looked at some online emulators but that gives this pop up: "Your Browser does not support Graphics API Webgl 2.0". Which makes it unable to test the site. On an actual iPhone this message does not appear and I can test the site.
Unless you want to find out about potential caching configuration issues 😛
true
Got it~
Hi: I have this error saying unityInstance is null
In my code I'm setting it like this:
and my jslib file
no one?
execution order issue -- find where it's being called when it doesn't exist yet
Im trying to host my game with webgl on github pages, does anyone know how to fix this overhead error? Unable to parse Build/Build.framework.js.gz! 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: gzip" present. Check browser Console and Devtools Network tab to debug.
One workaround is to not use compression. You can disable it in the player settings.
Alright
Better to use Decompression Fallback, which would still be faster than uncompressed one.
Is there a setting I can disable to not use compression?
found it
I think a development build will also not compress any of the output files
You shouldn't have to on more recent Unity versions 2021LTS and above. Unity automatically handles growing heap sizes upto 2GB depending on native browser and capabilities.
omg I'm using 2020 by now
So from documentation site here https://docs.unity3d.com/2019.4/Documentation/Manual/webgl-memory.html
I can see dynamically resizing of heap is supported from 2019.4 onwards. 👍🏻
but unfortunately it won't work on 2020.3.33f
Hi people!
All of a sudden my builds are missing the .framework and .wasm files! I only got those two on build. Any clue? 🙏
thanks Man it works : )
Try making a new build folder and make sure development build is enabled
I just tried that and it didnt work :-/
I'm on 2021.2.15F1
go back to 2020.3
we're using a feature only available on 2021.2.0b14+ (light layers) :/
but that's weird because it worked previously
it might be related with a setting
skinning is slow on webgl since it uses the cpu. Anyone know if it's possible to optimize this or make it use gpu skinning?
Hey all. I've got a project written in unity 2020.3.18f1 and when I build it and run the webgl from localhost it works just fine. But when I upload the build to my webserver it fails to load completely and throws a really vague error. Has anyone else encountered this before?
You might need to configure your server to handle the compression settings correctly. https://docs.unity3d.com/Manual/webgl-deploying.html
oh that did it, enabling "decompression fallback" got my webgl client running again
@upper drum
hello all, happy weekend ❤️
still struggling with the splash screen intro,
does the game size affecting the Unity splash screen at the beginning ?
how long the loading time starts up in average ?
do you notice the Unity splash screen at the beginning ?
does web gl support unity video ads in my case its not working at all
Hi guys (PLS ping me in your answer). I'm having a problem with publishing my game. It should be online and playable from an IPad. I wasn't able to find any solution in Internet so I'm asking here. I tried to upload my game (hangman) to Unity Play and to Itch.io. On Computer everything works fine (It's looking weird because game was designed for Ipad but I don't care) but on Ipad there are issues. Unity Play won't load it and Itch.io throws an error. Here's Unity Play: https://play.unity.com/mg/other/webgl-builds-194244 and here's itch.io: https://drummer-123.itch.io/hangman Code for itch.io: HangmanDrummer123 I'll send a folder with Screenshot about the problem. Btw everything is working fine in editor and Unity Remote 5
That's Folder
I'm guessing Unity splash screen will keep playing until the first scene is loaded in
Is there a special command for loading the first scene? I thought my first scene is always loaded and on pc my game worked fine... scenes were loaded like this in editor (picture)
No, scenes are not loaded in top down order
there is no guarantee on the order of any scene loading
so if you have a dependency in another scene, it will throw an error.
You could have a StartScene that has a script that loads scenes in order though
You could order the scenes however you like and try to use the scene.onsceneloaded callback to start loading the next one after the first loads
why it tooks forever her ?
almost 2 minutes
and what UnityPro does ? does it replace the splash screen ?
overall my webgl files is 50mb does it related to this Unity splash screen ?
just finished my game and tried to build my game to WebGL but i got these errors: https://hatebin.com/rlhuzrkozg
also using a macbook pro, 2021 with the M1 pro chip
unity version?
2020.3.23f1
update
Sir why my Unity loader takes forever ?
lots of assets
slow cpu
or you have it on another drive
best is C drive or an SSD
I thought assets was load in game @magic sundial
thanks tho
when you open a project
it loads the assets
ok now during first access google chrome refuse to load
for security reason ..
I only load the scene Win or Lose when game is over. SampleScene should be loaded first
what do u mean by that
Thx I could try this
any further tips?
Always wait about a half hour after eating before you swim
lol xD I meant tips to solve my problem but I guess you knew that 😉
haha yeah I dunno, try and decouple things as much as you can with an event manager system maybe
nothing pertinent
ups i don't know what you mean by that. I'm starter °~°
@high patrol or the other people here. I added a start scene which is just a screen with square on it. It won't even do anything but there are still loading problems on all different platforms. here is unity play: https://play.unity.com/mg/other/webgl-builds-194244 and simmer.io https://simmer.io/@drummer_123/hangman and a picture of error message
and here is a link to my unity forum-question: https://answers.unity.com/questions/1902289/problems-with-publishing-mobile-game-online.html
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
and this is hierarchy
simmerio works fine for me
I think you want to completely remove those scenes, I think unloaded scenes might load in when building
so you use it as well? or the game runs on your device?
You mean I should have only 1 scene?
I'm kinda upset: I made a new unity project with ONE red Button on screen and nothing else. I tried to upload it to Unity Play https://play.unity.com/mg/other/v1-mn67vv to itch.io https://drummer-123.itch.io/test-v1 and to simmer.io https://simmer.io/@drummer_123/test and guess what: everything worked fine on computer and nothing worked on Ipad. I got this message. So my problem seems to be related with something i can't handle myself.
any specific hint related to this splash screen ?
like it loads way longer then the map itself
if you want to do live audio/video (like audio chats or video streams), we've released an open-source library for that. Esp useful for metaverse projects: https://blog.livekit.io/real-time-audio-and-video-in-the-metaverse/
@round patrol This is not the project showcase section.
Hey! I'm trying to find this answer online everywhere but I don't see any concrete info about it:
In unity.play, Does the "Share Embed" code always redirects to unity.play instead of playing the game on my website? I wanted players to click on the "Play" button and remain on the site I'm embedding the game in the first place :/
Can anyone help me
I keep trying to connect to my world server in my WebGL game build im running into the following problems i have my webgl game on my website but it wont let me connect to the server.I even tried uploading to itch.io but it throw's a insecure websocket connection error and also when i type the url of the server directly in it works but outside of that it doesnt
and when i try to connect to the server through the webGL client on my website it says cannot connect to server and my server is up and running
your url for the websocket needs to be wss:// if you're going to use https
which means you also need a certificate. If someone else is hosting this app, that shouldn't be an issue. If you are hosting it, you'll need to buy and tie one to a website that points to your hosted content OR make a self signed cert and get it working locally
or just downgrade to http--if you aren't hosting you'll have to request them to do that
your simmerio build worked fine for me without errors
How do i make a certificate?The app is being hosted on a digitalocean droplet server im trying to post my WebGL Game onto a page on my website so people can play directly through my website
On iOS Browser? Ipad or IPhone?
ah, just desktop unfortunately
I would ask a professional or the website host to do it for you. Try changing your websocket url to wss://
how do i do that
you are using websockets correct?
ok well the site is saying to use a secure websocket
perhaps there is a checkbox in there to use a web socket secure
yea i checked that already im pretty sure let me try again
if you are managing all this just using digitalocean as a hosting platform, you will need to buy a certificate from someone like namecheap
You can create a csr using their tool https://decoder.link/csr_generator
Highly configurable CSR, Private Key and Certificate triplet generator.
yes
you will need 2 certificates -- one to secure the website itself, and one to secure the websocket connection that runs inside the webgl build
at least that's how I've done it locally
I haven't attempted to host online yet so you're a pioneer 🙂
so ill need 2 of the Positivessl certificates??
I think so yeah
or a one multi domain one
unless digital ocean has already given you one for your site
then just 1 for the webgl build
it looks like that mmo server script wants the key and password to that certificate, so I guess you'd include the cert inside your build with the password for it
where would i find the cert??
anywhere to look breifly?
its from the Mmorpgkit asset in the unity asset store
you buy the cert from namecheap and they'll email it to you
hey everyone, what service should I use for unity WebGl Leaderboard ?
I like the MEAN stack myself.
I'd recommend playfab but they keep changing pricing every 6 months. I'm part of the ID@azure program where you get it free for a year or two, but even then it isn't really worth it. We rolled our own solution but there is nakama also that is a great free open-source alternative
Thank you 🙂
https://fogbugz.unity3d.com/default.asp?1419797_t87pi3008ubaj7o3
Honestly, if this is the case, Unity should drop WebGL support altogether. Why bother confusing people with a dead platform support ?
Not sure if this is a low user pain issue for a production. Might wanna raise this on the forum to see if this can be re-evaluated and what Unity has to say about this
Lets hope this gets somewhere.
https://forum.unity.com/threads/broken-profiler-in-lts-2021-the-message-header-is-corrupted.1284503/
Hi, my FPS in editor is 100
However my FPS on running a webGL (build and run) server is very poor. (1FPS ish)
Unity stopped really focusing on their game engine a long time ago.
You want a stable game engine. They want to build HDRP V6, full rewrite.
What kind of content? Unity editor isn't subject to the limitations of the browser environment.
Could try running the profiler if you happen to be on a version where it isn't broken for WebGL 😄
I would argue they are focusing on it more than ever, it's just not the version we are currently using 😛 (Core systems for ECS)
My vert count is barely above 50k
What do I have to look out for, in the profiler?
Where the time is spent
Yea that is not really how this works.
From the colours, most of the time seems to be spent in animation and rendering
I disagree. All the hiring they have been doing and internal changes are pushing devs to experimental other projects and building contracting studios to compete with their own customer s. The only devs I see working on the actual engine now are the junior staff and a handful of originals. I think percentage wise they are working on it less than ever in the history of the company
But I also personally think that's part of why their stock has dropped 80%.
You really should profile the build, since the bottleneck might be different
Adding a couple of half finished features over a 3 year course isn't particularly impressive imo. Even their VR is a good 6 years behind where it should be
I'm really sorry, how do I do that? It's my first time creating a webGL build and I didn't know it would be so hectic compared to an android or windows build
Does that mean I profile using "standalone process"
From what I've seen externally, there has been a lot of movement from more experimental projects to more core features. Project Tiny and the AI Planner teams at least moved to core engine features for entities afaik. I'm guessing a lot of "missing" (audio, animation, navigation and other abandoned packages) teams are doing the same.
Pretty sure the process is the same for all platforms. Make a development build and connect to the build or have the build auto connect.
Oh okay. gfx.waitForPresent seems to be taking a lot of time sometimes. Can that be fixed?
I tried making a dev build. There's weird errors coming with no help from the forums... I might have to give up on my game :(
Can anyone help me im trying to connect by to my WebGL build game server but i was told i need a SSL certificate to connect through a secure websocket connection
:/
Not sure what you're asking
If you need an SSL certificate then get an SSL certificate
Does anyone know why when I export the game the display gets all distorted when in unity it's fine, one sec for screenshots..
As well as it has no coding, just the visuals, and it's really laggy/slow, anyone know why
@arctic rose im trying to install the SSL certificate on my digitalocean droplet server so people can connect through the web browser on my website and connect to my server
Ok, cool
I cant find a tutorial on how to do so..idk how to word it
Anyone had an issue where some of the animations disappear in a built game?
Only if they rely on non-webgl functionality (i.e. audio source GetClips) or a crash in the script driving the animator
But that should all appear in the browsers debug console
I'm havin some issues attempting to test a webGL build.
Unity 2021.3.3f1 (and the scene makes extensive use of the visual scripting)
All my webGL builds are giving me a plethora of browser errors & not loading.
"Null function or function signature mismatch"; among other things.
I can't even get an empty scene to build properly. Tried testing it on itch.io, probably not a webserver thing.
All compression is disabled, and compression fallback is also enabled.
(I had similar issues back in 2020 and 2019 unity versions, but can't remember how I resolved them)
lmk if anyone has troubleshooting advice!
aha, managed to isolate the problem to a specific shader asset I am using ("Wireframe Shader").
I can build to webGL in a new project until I import & install this specific asset 😦
try to upload it on itch.io ?
@sweet oriole said
localhost browser required certain treatment run it properly
How come only some projects can publish webgl but some cant?? also are there other ways of exporting a unity project that results in an openable file??
webgl has a lot of restrictions compared to other platforms, check pinned
It's too much work for me or almost anyone else to do this for you
The general steps for getting a certificate working is to get a cert (1. CSR, approval, receive the signed cert), then install it on whatever machine you're running your server off of and make sure your application uses it. Depending on your infrastructure, there could be a thousand different ways of doing that
I ended up contacting the asset/shader dev. I've tested on itch with no luck, as well.
I can confirm that simply installing this particular asset breaks all webGL builds though, doesn't seem to be entirely a webserver or Unity thing.
what kind of shader is that ?
URP kind or default ?
WebGL doesn't support some shaders, you can try and force it by changing the OpenGLES to v3 or whatever, but even then. Some shaders just won't work though and you'll need an alternative or rewrite for it.
copy that @charred briar
never tried v3
definitely worthed to try
Hello, i'm trying to serve several unity webgl app using an nginx server. I would like to use a different location for each webgl app. Is there an example for this use case ? So that I can access to my app1 using <myserver addr>/app1 and to my app2 using <myserver addr>/app2
You just put them in those directories
But what is the nginx configuration ? I'm using this example: https://docs.unity3d.com/Manual/webgl-server-configuration-code-samples.html
I works when I open <myserver addr>/ but <myserver addr/app1 gives me a 404
Do you have an index.html in that folder? Do you have an idea of how that address is formed?
The configuration itself seems to be applying the settings based on file type, so that configuration is probably fine. You should be able to see the index html regardless of whether the configuration for Unity builds is applied.
Using the example configuration it works only if the webgl build app is in path indicated as root and anly at address <myserv addr>/
Did you move the built files into the app1 folder?
That's super easy to do with the Unity React component
You can add folders and just point each new webgl build component to a different folder
I don't know what is Unity react component, even after read the doc, it seems to be an npm lib. I don't know how to use this using nginx. I don't know how to use this to "serve" multiple webgl unity app.
React Unity WebGL provides an easy solution for embedding Unity WebGL builds in your React application, with two-way communication between your React and Unity application with advanced API's.. Latest version: 8.8.0, last published: 3 months ago. Start using react-unity-webgl in your project by running npm i react-unity-webgl. There are 7 othe...
Somebody can help me with webgl error "access to fetch at "site1" from origin "site2" has been blocked by CORS policy
I have a webgl game hosted online and After i connected my domain to It. From the domain of the host the game works and i can get data from database. From the mine domain i can't access to the database
you have to add an access exception to the cors policy for all domains you want to allow access from
Is Unity and WebGL with Vuforia(ImageTracking) possible?
Has someone a guess, I cant find a ressource
I'm having problem of out of memory in my webgl build
after chaning scene back and forth multiple times the build crash
is there a good way to get where the problem is?
Hey folks, I have a SignalR back end I would like to have a Unity client work with for a small project I am doing. I've found a lot of solutions online and was wanting to ask the braintrust what their recommended way of doing this would be.
if you want to use signalR then yeah there's lots of solutions out there that show how to get it working https://github.com/evanlindsey/Unity-WebGL-SignalR
If you want to have more granular control of the transport, you could use a js plugin to build a websocket
Oh this is perfect! Idk why i couldn't find this...my googling needs work haha.
Hello, I am using addressables and I'm following the link below to check if there are any catalogs to update, if yes, then I would ClearCache. I have enabled "Disable Catalog Update on Startup". Catalog to update is greater then 0 when I make a build and run. However, if I upload the build and addressables to my own server, catalogues to update is always 0. Any idea why that maybe the case? Sorry if I didn't explain the problem well enough. I can try to clarify if it doesn't make sense. https://docs.unity3d.com/Packages/com.unity.addressables@1.16/manual/UpdateCatalogs.html
Does anybody know why i cant upload it to webgl
Things in UnityEngine.Windows are available only on Windows builds
Is it normal for a webgl build to take 150 seconds for an empty scene?
No, usually it takes much longer
Thanks. Any way I can test without pulling my hair out?
I don't think there's anything that would help, other than trying to test in the editor as much as possible without compiling
Hello, i'm trying to export a webGL, but the output folder is empty
Do you have errors in the console?
ur exporting to an invalid folder?
how would I fix that as i tried to export in a different location but same problem
are they js plugins or dlls or what
Hello, I'm new to Unity. I recently completed a tutorial and uploaded the project to github pages, but nothing appears to load. In the console, a load error can be found, but not on a local run with Visual Studio code.
Hmm if they used DOTween, that unity package supports webgl. If you don't want to use that package you'd have to implement your own version of what it does for functionality--or understand that functionality will go away. DOTween is a fairly well known package, I'd suggest just keeping it. Others may be different. Kinda have to go through every package and resolve issues one by one
I'd recommend starting a local git repo and committing after taking out every package and resolving conflicts relating to a specific package
Hello, i currently have problem when i try to publish my build in webgl, i have the following error: (screen). I tried to restart unity, my computer, build another version, remove and add webgl package , restart my box but nothing changed. Do you have any advise for me ?
Ok, problem solved. I don't do anything but the upload as works.
hi noticed that my .ignore file had build in it XD
(Please let me know if I'm in the wrong channel!)
Hey folks! I don't know much about Unity, but I'm a proficient Cinema 4D user. I'm currently looking for a solution that would allow me to preview 3D models via an online website (if not possible, then via local exe app). Is Unity capable of creating this kind of app? I would also like to implement some simple features, like the ability to click on an object to see a short description. Perhaps something similar to SketchFab viewer?
Build a Cinema 4D animation from scratch.
Thanks! @mortal vault
i made a websocket client in unity and i converted to webgl
but i have this erro
you must be missing the node_modules
First try npm install ,if the issue is not yet fixed try the following one after the other.
npm cache clean ,then
npm install -g npm,then npm install,Finally
ng serve --o to run the project. Hope this will help....
If none of those work I would wager to assume you don't quite know how to setup a node project. I'd direct you to their getting started section
or i just run a nodejs webserver?
Do you know how a nodejs webserver runs?
yes
but im running on xampp webserver
but... idk why webgl wont load
ok gotcha. I haven't used xampp--the joys of web development being so scattered haha
some of those errors seem like it can't find a package or it can't find the actual project to run
hmmm
Like
itch.io can run it
but i have custom server
i am having an issue
this is uploaded to itch.io but its giving me this error
I'd recommend shifting to just using node.js instead of xampp. It seems that's a combined solution that uses the Apache HTTP Server
yeah but idk how configure cloudflare => nodejs
or nginx idk
Like my unity editor is the serverhost @high patrol
if i build and run
if you're just debugging might as well not use it
no point to use that until production
what is ur plugin for mail server tho ?
and how to do in Unity with Telemetry ?
Hi, I'm very new to unity and while i was making the microgame in the tutorial, i was on the last step where i had to publish the game to webgl. i clicked build and publish and a bar came up and loaded slowly and when in completed it disappeared and left me w the same screen i had before i clicked build and publish, only this time with the error in the bottom left. it says buildfailedexception: incremental player build failed is there anything i could do?
i've tried multiple times and in different folders
I want the users of my web-gl game to be able to download game analytics. Is there a way in which clicking a button (e.g., Download Stats) can automatically download a .csv file?
I think you need to provide more context for the error
these all appeared in my console
Hello, I am saving a file inside of the Unity editor to persistentdatapath, which works, but in webgl build it does not do so. Any advice?
Hey good day.
One question people, i have made a repo for my unity projects and i have a little problem. Using the default unity .gitignore the WebGL stuff (build and a "webgl_sharing" thing that i dont know what it is) are not included in it.
Should they be added to the repo or i need to update the .gitignore?
you fixed error?
Out of memory.
I did, I had to optimize it.
my build 70 mb only i have good graphics i dont want to optimize this more... how??
Got no idea, sorry. My final build was 300mbs or sth? I don't really remember
And I am sure it is not about your graphics card or such a thing, I have a trash pc
On webgl
maybe i need check setting? who can help with that?
why there are no platform for opengl on Unity ?
Basic File IO operations work on browsers too. Send code. I assume you aren't expecting the files written in editor to show up in your browser build.
Use memory profiler package to roughly see where the memory is used for hints. Managing what is loaded into memory becomes relevant in some projects.
Because naming platforms based on graphics API is silly, since platforms and the build can support multiple, especially now that WebGPU is close in the horizon. Unity probably went with this route to differentiate from the old Unity Web Player.
It looks like it had to do with scene changing after saving. Odd.
Watch out for execution order issues. Builds are a common place to find code that is relying on undefined execution order, like code that is accidentally relying on Awakes or Starts to run in a specific order.
Also worth noting that you might need to tell the browser to write changes in the browser's virtual filesystem to the disk. Random example: https://gist.github.com/kou-yeung/839e5d39d16a92f4f2e1209e31f20dcb