#🌐┃web

1 messages · Page 5 of 1

grave ember
#

You are thoroughly unhelpful

charred briar
#

I'm sure you looked into this option, but my guess on that error is the device ran out of memory.

mystic grotto
fallow fox
#

can anyone help me, when i build webgl and open the index.html file, it would say an error. How do i solve this? I use 2021.3

grave ember
fallow fox
grave ember
#

For sharing something like itch.io is an easy free way to put it online.

fallow fox
#

Thanks, i would try it like this

grave ember
#

Gl

tulip drum
#

has anyone here ever tried implementing voice chat with webgl?

random talon
#

Does somebody know where can I get a WebGL responsive template for latest unity versions? (2022.3)

random talon
#

I'm struggling a bit, when resize the broswer that it changes the camera fov

oak tiger
#

Hey everyone. We are having an issue where, we have a Database on a server and we Query it with Unity WebGl through HTTP requests (not HTTPS) to get the table associated with our computer name. This used to work in unity 2020 but since we updated to unity 2022 it stopped working. I noticed there is a new setting in player settings called allow HTTP requests and we have this set to always allow. Any idea what might be causing this? Anyone can help? Thanks 🙂

jolly notch
#

Is urp SSAO not working in WebGL?

ruby nova
plain shard
plain shard
tulip drum
plain shard
tulip drum
#

Screenshot of what?

plain shard
#

of the game

#

agora is a good choice

tulip drum
#

yea you can actually visit it at https://normies.ai, although we're in version like 0.0.0.0.1 lmao

#

Player sprite looks pretty awful we're working on a paper doll/player customization system at the moment so it'll be updated soon.

plain shard
#

gotchya

#

what is your goal?

#

there's a lot of stuff built here

tulip drum
#

An mmo, we don't have too clear of a vision of what the finished game will look like, one of the bigger things we're trying to do is add JEPA automous agents to the game.

tulip drum
tulip drum
#

startup to be more specific

tulip drum
# tulip drum An mmo, we don't have too clear of a vision of what the finished game will look ...

We're trying to implement autonomous agents based off this paper: https://arxiv.org/abs/2304.03442

plain shard
tulip drum
#

Far more haha, but the investments "we've" (I put quotes because im an employee) gotten aren't focused on the game but their investing primarily in 2 other products of ours which aren't related to gaming.

plain shard
tulip drum
#

lmaoo

plain shard
#

i make unity games and services, i also author a lot of unity webgl engineering content. maybe instead of "what is your goal?", what are some of the promises you guys have made

tulip drum
#

We haven't made any promises yet as the game hasn't even been announced yet haha. But I think saying mmo rpg sums up what we're attempting quite concisely, there'l be crafting, a skill system, potions, iron smithing, dungeons, etc.

tulip drum
#

Also generative AI, so on top of the autonomous agents most npcs will have elevenlabs type tts and can speak directly to you based off your circumstances, rather than generic dialogue which you would normally find and isn't tailored to specific players

plain shard
#

are you in charge of all aspects of this game?

#

in practice?

#

promises can mean, to stakeholders besides players

tulip drum
#

Yea I'm the lead designer and programmer at the moment, we might hire an intern or possibly full time person soon though.

plain shard
#

cool

#

i am reacting to how much stuff is going on

#

which is good, that i see, a lot

#

what is your personal goal then?

#

like is it to make a game people like to play lol

#

is that the goal?

tulip drum
#

Yea the primary goal at the moment is a game many people would play, it's meant to be an mmo, we're hoping to eventually get 100k mau

#

bw if you're looking for a job let me know and send me some of your content, I'd probably recommend you if it's good, there's a good chance you might know who my boss/one of the cofounders is, I rather not say in this public discord though.

#

btw*

tulip drum
ruby hound
#

Hi everyone, having a WebGL build issue here I was hoping someone could help with.

Our project has initially been developed for VR, and is being converted to also support WebGL builds. I have followed the steps to get past the majority of issues with this (namely Oculus Integration Assembly Definitions and direct references to the Oculus package). I now have WebGL building and deploying to Unity's LocalServer.

However, as the build gets about 95% of the way loaded, I get a long error / stacktrace that culminates with: "Object.removeRunDependency" somewhere in my WebGLBuild.loader.js file.

#

TypeError: window.OnUnityLogMessage is not a function is also appearing

ruby hound
plain shard
random talon
#

Do somebody knows if its possbile to initialize an embedded webgl in first place and only after pressing a button to actually boot it up and play?

arctic rose
#

What's the difference between initializing and booting up?

random talon
#

for example press a button "start" that i make on the frontent

arctic rose
#

Can't you just make the button in the game?

#

If you really want to do it outside Unity, edit the page CSS so that the game container is hidden by default and add a HTML button that shows the container

high patrol
#

why not utilize routing of an SPA to point to an Init endpoint that contains a button, and let the button route to the webgl game endpoint

fallen sable
#

its giving be this error?
Unable to parse Build/online game.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.

turbid falcon
fallen sable
turbid falcon
#

Which file is 26 mb?

#

Afaik the size limitation is per file, not the whole project.

fallen sable
#

its called gym app.wasm

#

its in the build folder

fallen sable
turbid falcon
#

Is gym app the name of your project?

sweet oriole
#

Do you need to do this on Github Pages? 😛

fallen sable
fallen sable
sweet oriole
#

I wouldn't use Itch either, but something like Netlify.

fallen sable
#

so i just had the idea of just grabing the link to what itch displayes and i now have a link to just the game and nothing else

#

i got it from inspect element

#

but now its giving me a ugly link, so i could teoretically just input the same src to a html run by github with the actually link that i want

#

so the issue is techinically fixed tnx guys

stoic scroll
#

My mouse clicks are coming in...for lack of a better word, slowly when playing my webgl game in Safari

#

I have to hold the mouse down for around half a second for it to register

#

interestingly, if I mash the mouse rapidly, it eventually registers a click

#

Works fine in Chrome (on macOS)

#

Keyboard input is fine, so it's just clicks. I wonder if the browser is trying to do something clever (and failing)

plush pawn
#

Who makes 3D URP Webgl games? How to optimize the game properly?

stoic scroll
#

that's a very broad question. have you figured out what's bottlenecking you?

ruby hound
#

Hi, having an issue with URP and WebGL builds on 2021.3.4f1. Anything using the URP Lit shader is invisible in build. Have tried a couple of fixes I've seen online (removing receive shadows from the material, setting surface type to transparent, regenerating shader includes) but nothing works. Any advice?

sweet oriole
#

Doing a desktop build can be helpful to narrow things down

plain shard
plain shard
plush pawn
plain shard
#

it will help communicate what you have

plush pawn
#

I have 500+ fps in unity.

#

in the browser 140

#

in browser on mobile 40-50 fps

#

I can not figure out why on a cell phone in an empty scene slows down and drops fps

spare hamlet
#

Hello hello, I'm having and issue with my webGL build on itchio, the game runs the made with unity spalsh screen, but right after that, I receive this pop-up, does anyone knows anything about it? 🤔

sweet oriole
plain shard
spare hamlet
#

Yooo thanks for replying, it's fixed already, I had a confusion selecting which scenes to build 😅

#

@plain shard

main gust
#

@cold frost why did you ban me

#

i literally did nothing wrong this time

cold frost
main gust
cold frost
#

Why are you talking about these things here?

main gust
#

because that was really unfair

cold frost
#

Wanna get banned from here as well?

#

Wth

vestal cloak
#

!mute 893147990359957524 1d no you won't

somber questBOT
#

dynoSuccess gamedev_uv was muted.

main gust
#

thank you

vestal cloak
#

!mute 778947882086432790 no you won't

main gust
#

i really appreciate that

somber questBOT
#

dynoSuccess deliciousbrownies was muted.

vestal cloak
#

!unmute 893147990359957524

somber questBOT
#

dynoSuccess gamedev_uv was unmuted.

vestal cloak
#

@cold frost sorry wrong id lol

cold frost
#

He joined the other server and spammed the same message like 10 times i kicked him out
He rejoined did the same shit again

opaque osprey
#

Hello. I have a Unity scene added to my Blazor WASM (Single Page App). When the user goes to the page with Unity, it works fine. But, when they leave the page I get an error, which repeats until the browser crashes: TypeError: Cannot read properties of null (reading 'getBoundingClientRect')
at _JS_DOM_MapViewportCoordinateToElementLocalCoordinate (https://localhost:7201/Build/Build/Build.framework.js:3:27093) Anyone know how to prevent this?

twilit sluice
#

Does anyone know a free package or other way to create a file picker on WebGL?

high patrol
opaque osprey
golden summit
#

So, I can't build any WebGL project, it just create a new empty folder. Can anyone help me (there's 10 to 15 errors in the console when I try)

#

I was just following the Unity pathway to learn and I'm stuck bescause of this error

elder pelican
golden summit
#

Oh, sorry

#

All the errors are similar, they tell me that there is "no module named '_ctypes'" but in another path with another script

#

And the console write "[Version and build] Build failed! 00:00:15.4654959

#

I use a Debian 10 OS and Unity 2022.3.11f1 with the WebGL module

arctic rose
golden summit
#

It don't work but it's definitely an error with Python

golden summit
#

I manually reinstall Python 3 and it finally works !

#

Thanx !

gleaming granite
#

Hello everyone!

I've been struggling for so long with the Cross-Origin Resource Sharing (CORS) issue when making requests to APIs using UnityWebRequest in WebGL applications running in the browser. I've researched and tried various solutions, but they all seem to introduce layers of complexity I'd rather avoid.

Has anyone tackled and resolved this issue in a way that could be considered "elegant", "simple", or even "ingenious"? Any advice or experiences you could share would be greatly appreciated.

Thanks in advance!

arctic rose
#

There's only one reasonable solution, depending on whether you control the API or not. If you do control the API, add the correct CORS headers to its responses. If you don't, you need to make a proxy server between the API and the game.

gleaming granite
arctic rose
#

It's a security feature. If there was an easy way to get around it, it wouldn't be a very good one

gleaming granite
arctic rose
#

It should be relatively straightforward depending on the API. There should be plenty of resources online

gleaming granite
plain shard
#

it will help me understand where you are on your journey

gleaming granite
gleaming granite
plain shard
plain shard
# gleaming granite what is this for?

this is to avoid using webgl entirely. you "just" have a streamed machine, but it's very powerful, but it's not a VM, it's not virtual desktop, it's not furioos, it works on mobile, it loads instantly, etc. etc.

#

so if you need to call an api, it Just Works. indeed you can use however much memory you want, you can even run models locally, if you choose, straight out of e.g. a comfyui workflow, for example, which i maintain

#

does this sound interesting to you?

gleaming granite
plain shard
#

perhaps if you had to deal with less webgl crap and could just push to git you will have more time to do cool things

gleaming granite
#

I'm good for now with webgl, I just need those web requests working in my projects 😶

tropic patrol
#

does anyone has performance issues with firefox? my game run smoothly on chrome (60fps) but on firefox I have like 20, I checked hardware acceleration and it's enabled, both browsers are on latest release

edit: turns out using a video player, even with a 640x480 resolution has infamous bad performances, does anyone has an alternative to use?

plain shard
tropic patrol
#

that’s not fancy but it gets horrible performances on firefox, it was taking like 74% of the resource for one frame

outer wave
#

We've no multithread support, right? Trying to parse like 5 dictionaries worth of words (chopping them into multiple different substrings), so anything to improve loading times.

#

what about compute shader? Maybe I can work with that.

plain shard
outer wave
#

just some word game where you're presented with substrings to construct words out of

plain shard
plain shard
#

Not the one you start with. I get that you start with lists. What is the data structure you are turning word lists into?

#

Or is the answer “none”?

#

And the word lists, how do they get into your game? Are they in your Assets/ directory? Are they downloaded from the web at runtime into your game?

plain shard
outer wave
#

Ah, ok yeah it's been a while but I've it parsed already from some python script my mate made

plain shard
#

Answer my questions though

outer wave
#

I think the problem is object construction from reading it in from json

plain shard
#

Try to reply to the questions specifically @outer wave

outer wave
#

I'm using streaming asset folder for webgl

plain shard
#

Okay

outer wave
#

actually need to fix that now cause betterassetstreaming api doesn't work with webgl apparently

plain shard
#

Can you reply to the data structure question

plain shard
#

Stay focused on my data structure question

outer wave
#

sec trying to navigate what I was doing lmao

plain shard
#

So the answer is “none” then or “a mess”

#

That’s okay

tropic patrol
#

what a joke

outer wave
#

nah, it works fine. Just ive left with loading issues which are apparently on webgl but not android

outer wave
#

and I think it's because of the streaming asset like you're saying

plain shard
#

It’s nit

#

Not just that*

#

I mean I know know few of the facts,

tropic patrol
#

I wish I would have tried cocos or godot before buying assets and stuff.

plain shard
#

And I’ve made word games, typically you store the word lists in a data structure, like a trie, that is useful for these sorts of games

#

Or maybe it’s a Dictionary

#

There’s a big difference

outer wave
#

Yeah, I actually started with parsing because these dictionaries are like many mbs in size

plain shard
#

Or it’s a List

outer wave
#

but im looking at it now and I just chop it up ahead of time

plain shard
#

You’re saying dictionaries, and they’re word lists right?

outer wave
#

right

plain shard
#

Okay but if you have text word lists that are just smaller files

#

So the answer is a mess right?

#

Like what’s the data structure in memory in C# these get turned into?

#

You can’t solve this problem without the answer to that question

#

You can try and figure that out eventually. It can be a long journey or a short one

#

Sorry I’m not trying to be annoying

#

But ultimately to make it load fast, you will have to put, in your Assets folder, a binary file that is the in memory representation of the data structure you need. Then you can load it directly without parsing.

#

You haven’t done any profiling so you’re just spitballing. But if you do, it will be loading the files and the parsing that will be incredibly slow

#

They are just as slow on Android, it’s just that the StreamingAssets folder is already there, and I don’t know how you do the parsing, it may be non blocking

tropic patrol
plain shard
plain shard
#

Dunno

tropic patrol
#

@outer wave be polite

#

ridiculous

outer wave
#

what

tropic patrol
outer wave
#

I'm looking at the streaming asset folder stuff

#

Just trying to figure out where I left off here with webgl, but I know that async methods werent working

plain shard
#

Okay but forget about that

#

Please try to answer my question

#

Are you saying you just have List<string>?

outer wave
#

It's Json into a list that's it

plain shard
#

Just to confirm

#

You mean a List<string>?

outer wave
#

list of structs with the strings

plain shard
#

OKAY

#

Can you show this struct?

#

I mean show the code

#

List of structs

#

Like literally the field and the struct so that it’s unambiguous

outer wave
plain shard
#

Okay well everything in this file is going to be slow

#

Especially in WebGL

#

Zip, parsing, big memory allocations

#

Downloading

#

And all at runtime

#

So you’ll have to rewrite it

outer wave
#

right it's that I made it for android and thought webgl was light enough to port it over

plain shard
#

But I’m glad you shared it

outer wave
#

but apparently can't use a lot of my async methods or apis

plain shard
#

You can read my pinned tips and tricks on WebGL on the forums for more info

#

Well do you want to rewrite it?

outer wave
#

probably will look into it as it would be nice to port it over

plain shard
#

Do you understand what I mean by “representation in memory”?

#

You will do textasset.bytes

#

Then those bytes go into the constructor of an object that is like “WordListStorage”

#

And its methods are whatever you need to query, and it does O(1) arithmetic on the bytes to get the strings or whatever

#

No transformations at runtime

outer wave
#

it's not the cleanest in general even for android, but I can see what I was trying to do the last time I picked up on this

plain shard
#

Try to model the end result of the parsing that you need for your game as a single instance of a class

outer wave
#

but I've actually experimented with some other general ideas and yeah, it's down to a memory issue here

plain shard
#

Then you can read online how to model the individual parts of it from a span of bytes

warm talon
#

Hello. Can anyone help me with this

high patrol
#

Implement a robust communication layer that can handle large files by segmenting them into smaller ones and reassembling them on the receiving side

plain shard
#

also, are you aware of the limitations with loading assetbundles in webgl?

#

also, what do you mean by memory leak?

#

do you have a screenshot of the game?

gilded cedar
#

hey all
does anyone know how these errors could be fixed? i tried searching online but none of the solutions that mentioned the same errors worked (tried rebuilding all assets, tried deleting the asset cache, tried force downgrading then upgrading and reinstalling the toolchain package, none of it worked)
they only show up when switching the build mode to webgl, and they happen in every project (even tho i build a few webgl games already, and none had this happen)

hexed atlas
#

Hello fellas!
I'm currently working on a project that might work with a good audio and microphone I've worked before with Wwise but it seems to don't support WebGL. Maybe someone know the best path to take on this sound engineering? Thanks! @here

plain shard
hexed atlas
plain shard
#

so it's not a game? it's like a training?

#

like it's an industrial application?

#

or a branded game / ad?

hexed atlas
#

Its like a weird mixing of habbo and roblox, but one of the conditions is to get entirely on webgl

charred briar
#

There are lots of options in that space. Photon Voice. WebGL Voice & Text asset, etc.

plain shard
#

it's just a really bad fit for webgl

#

who's going to use this for more than 30s but wouldn't bother to install?

charred briar
#

We have lots of clients with XR simulations that need them for WebGL as well, its pretty standard in education.

plain shard
#

does this have to work on phones?

hexed atlas
#

Dude, it's not my business haha

#

I'm just the guy who does it

charred briar
#

We had to create something for our SocialVR platform as well, to let browser users join the same community and participate 🙂 It's pretty common imo.

plain shard
charred briar
hexed atlas
plain shard
#

i can tell you now, the webrtc package is not something you want to go down

hexed atlas
hexed atlas
plain shard
plain shard
#

are they making their own art in 3d?

hexed atlas
#

Its an immersive 3D work, that's why I need a good sound system

plain shard
#

got it. and it's original assets or scanned assets or...

#

like when you say immersive do you mean photoreal 3d assets?

charred briar
#

What are you using for networking in the existing version?

#

I'd definitely stay close to that if you can. So if it is photon, adding photon voice, etc.

hexed atlas
hexed atlas
#

Gotta go guys, thanks for the recommendations!

charred briar
#

Yeah with mirror, you'll end up needing to create something manual, imho.

plain shard
# hexed atlas Gotta go guys, thanks for the recommendations!

i build a pixel streaming platform you can easily try, for free, if you so choose. you can achieve multiplayer by having multiple people share the same unity instance, so like a local multiplayer game. and wwise would just work. but i'm trying to understand what precisely it is that you're making

#

i'm not trying to be annoying

#

most people will bounce waiting for something to load

#

so that's why i was asking if it was an ordinary video game - generally people are willing to wait for those to load - but if it's something that gets an audience inbound from e.g. instagram, tiktok, cocktail parties the creators of this experience go to - webgl is impracticable

frosty idol
plain shard
plain shard
#

@frosty idol you will have to correctly configure cross origin policies if you want multithreaded support in mobile safari

frosty idol
# plain shard > Why does profiler show me ~60 fps, when the game feels like ~10? what browser ...

Unity 2022.3.9f1
Firefox 117
Win 10
CPU (4/8 @3.6Ghz)
GTX 1660

I've tried to set this bool to true
And got an error
Uncaught (in promise) Your browser does not support multithreading.
So, it seems that firefox doesn't support multithreading out of the box.
Will try to tweak some settings.

Tried to turn on everything thread related, but no dice.

Upd: tried google chrome, the error is still here.
Upd2: tried to set 'hasThreads' to true in the 'Web.loader.js', the game started, but the performance is the same.
Upd3: it worked in google chrome at least
Upd4: it stopped working, when I've tried to upload the build to itch.io

plain shard
#

if it's an ordinary, WAN accessible domain name, write wan-domain.com

frosty idol
jade flame
#

How to use .env files in Unity WebGL build?

In Emscripten recommends to use ENV variable and presetup it with Module.preRun

Emscripten-generated JavaScript cannot access the computer’s environment variables directly, so a “virtualised” environment is provided

// *.jslib
mergeInto(LibraryManager.library, {
  Message: function (str) {
    console.log('Message', UTF8ToString(str), ENV.NEXT_PUBLIC_DOMAIN);
    window.postMessage(UTF8ToString(str), ENV.NEXT_PUBLIC_DOMAIN);
  },
});
  • Emscripten cannot access to process.env
  • I need to get NEXT_PUBLIC_DOMAIN value only
  • I can run build with command line using custom Build class:
using UnityEditor;
using UnityEngine;

public class Build
{
    static void WebGLProductionBuild()
    {
        BuildPlayerOptions buildPlayerOptions =  new BuildPlayerOptions();
        buildPlayerOptions.scenes = new[] { "Assets/Scenes/SampleScene.unity" };
        buildPlayerOptions.locationPathName = "Build";
        buildPlayerOptions.target = BuildTarget.WebGL;
        buildPlayerOptions.options = BuildOptions.None;
        BuildPipeline.BuildPlayer(buildPlayerOptions);
    }
}

With following command:

. .env.development && Unity -quit -projectPath . -batchmode -executeMethod Build.WebGLProductionBuild
plain shard
plain shard
#

even if you achieved your goal of "using .env files" it wouldn't resolve your issue, because that's not how next works

#

if you want to access a value from the page, it seems you already know how to do that

jade flame
# plain shard if you want to access a value from the page, it seems you already know how to do...

I want to send value to the page from the Unity WebGL app, which is here a wasm code read by Emscripten.
In Unity documentation recommends to duplicate class method in *.jslib file so when it called the same method in jslib file will be called.
https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html

So, here will be called window.postMessage, where in second argument need to pass the page address to strict application by which address it will be listened.

Always provide a specific targetOrigin, not '*', if you know where the other window's document should be located. Failing to provide a specific target discloses the data you send to any interested malicious site. https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

What I want to archive, to make a template for Unity web apps, where I can specify that targetOrigin in one source of frue so inside unity app I send message, and inside nextjs app - listen it.

MDN Web Docs

The window.postMessage() method safely enables
cross-origin communication between Window objects; e.g., between
a page and a pop-up that it spawned, or between a page and an iframe embedded within it.

#

The path I chose is not easy one, but I don't want to store any secrets in the repository, so I decided to use .env files both in NextJS and Unity code.

plain shard
#

i am not sure what the issue is here, you don't need to interact with next.js's unusual public variable configuration inlining thing at all

jade flame
#

ok

plain shard
#

why are there popups or same origins? what is the game / experience?

jade flame
#

I already did that I want. Now, my goal is to improve it.

plain shard
#

so maybe something is misconfigured in firefox for you

frosty idol
hexed atlas
#

Hello guys! I've been really stressed trying to deploy on webgl using some playfab services for multiplayer. Maybe can someone help me with this? 😦

hexed atlas
#

The multiplayer system works pretty fine on windows and android, but it does not on webgl

plain shard
#

what is the context of these error messages? they are obviously meaningless by themselves

#

like describe what you are doing

#

and then why you looked in devtools in the first place

#

are you confident playfab is supported in webgl? what are "some" services?

#

oh yeah you were asking questions earlier

plain shard
hexed atlas
#

Yeah

plain shard
#

did you author the windows and android version?

#

what exactly isn't working in the game?

hexed atlas
plain shard
#

i think the first step is identifying where these exceptions are coming from. you can make a development build and enable demangling in order to see a real stack

#

-sDEMANGLE_SUPPORT=1 is the additional emscripten compiler args although i think that's automatically enabled by checking Development nowadays

plain shard
#

when you launch the game? are you confident they are associated with "connecting?" what does that concretely mean, connecting via mirror?

#

are you trying to use mirror peer to peer with webgl?

plain shard
sweet oriole
desert nexus
#

What version of webgl is ued by unity in the web platform?

sweet oriole
crude atlas
#

anyone know a reason why the second I build and run my game in webgl, Painted details on terrains turn almost invisible???

dusty glacier
#

check quality setting

crude atlas
#

Nope, on high fidelity for webgl

plain shard
#

are you saying the left is incorrect and the right is correct?

drowsy crane
#

Anyone heard of using webGL as a way to let people use multiple mobile devices as touch controllers for a game running on a PC as non-web-gl?
Would want the mobile device to just display joystick/buttons & transmit data to the game.
I've kinda implemented a non-webgl solution last year that used websockets to send touch info to a nodejs server running on the PC & then sent that data to unity via redis. But curious if a webgl solution might make more sense?

#

I setup 360 projection-mapped geodesic domes as an Art Installation and have a game that let's someone fly the dome around space with a joystick. I'm adding multiplayer to it where people can use their phones to interact

frosty idol
plain shard
plain shard
drowsy crane
drowsy crane
drowsy crane
crude atlas
# plain shard are you saying the left is incorrect and the right is correct?

Sorry for the delay, but yeah, the right gets the grass to spawn and render, and the left it’s not visible… if shadows are turned on however, the shadows still appear just the meshes have their alpha turned down to like 0.1. (It’s for my game dev coursework… we’re only allowed to use 3D primitives included in unity, no external stuff is allowed)

plain shard
#

pretty much flawlessly

#

you will have to understand how input system works. that is the main obstacle

#

you can of course reinvent input system yourself

#

that's all you'll end up doing if you do the blub thing of like
oh i need a class that represents each user
now i have to associate a remote connection with a user as a device
now i need some way of representing the touch...

input system has already done all that

#

does that make sense?

#

it's a huge amount of IT either way

#

InputSystem.QueueEvent allows you to pump input system events from anywhere, that is the single simplest way to remote input. you can also assign a user and AssociateDeviceWithUser. then you basically have a local multiplayer experience

plain shard
drowsy crane
plain shard
#

how much do you want to do input system

drowsy crane
proper stone
#

whats the best way to fake a cloth simulation in webgl?

charred briar
#

You could use bones, joints and sphere colliders in most cases

plain shard
proper stone
#

I found that simulating in blender and then converting to shape keys and exporting to unity as fbx works pretty well

#

Had some problems with file size but I’m good now

charred briar
#

Yeah that'll work too

#

It wouldn't be physics reactive but might not be needed anywya

glacial barn
#

Hi, I can't show an example right now, but webgl quality is good in any pc, but is very bad with low fps in mobile devices... is it because it's incompatible or shouldn't that happen?
I'm using URP 2D template

ashen matrix
#

Hello, i have got an WebGL Asset, which i want to scale and rotate by pinch.
Pinch Rotating works fine, but if i finger pinch scale the object the WebGL crashes instantly (Android and iOS) with these error message. Does anybody has got a hint? 😦

arctic rose
#

You'll have to set up remote debugging to read the error message from the console

high patrol
#

are you using webgl for mobile? Are touches officially supported for that workflow?

ashen matrix
#

Yes. I have many other project in which it Workshop correctly 😦

high patrol
#

can you scale the object normally? It might be the type that it's not happy with

ashen matrix
high patrol
#

like just hookup some other input to scale the transform. Just narrowing down that it's probably a type issue with touches

plain shard
warm cargo
#

Hello, I wanted some insights on how I can incorporate a website with a Unity wegl build.
Lets say I have a website made with react. There are several buttons and I want to attach Unity games/scenes to each of the buttons.
I am pretty new to the webgl build and wanted to know possible ways this can be done.

charred briar
rare quail
#

Can i use vivox in webgl?

#

Voice chat

charred briar
#

If you Google that you will get a forum thread from Unity that says no as your very first result.

ashen matrix
plain shard
#

it's an asset living in 3d?

ashen matrix
#

Ist is an Avatar hat you can Place markerless. If you try to pinch scale ist crashes 😦

plain shard
#

there's no webgl. it just loads instantly, and all you have to do is push to git. you never have to build yourself.

#

this works on mobile safari, as you can see

azure spruce
#

Hello, i have very big issue about loading times. My game is only 30mb and i got 50mbit internet speed. Usally game speed beetwen 15-30s but sometimes is increase to 3-4 minute. I'll be happy if you can help me about that.

Game size is 30MB. When i'm check in profiller Set Texture is like 10-20MB, Render Texture is 200MB.

plain shard
#

then time it

#

on mobile, everything loads slower

plain shard
verbal relic
#

Hello. I've created a WebGL project, but I have an issue with slow website loading. How can I speed it up?

arctic rose
#
  • Enable compression in Unity settings and on the server
  • Reduce game size
  • Find a faster website host
unique hawk
#

hey guys 🙂 I need to be able to trigger javascript code from within c# and I have been trying to use the following code ```cs
public class IFrameToggler : MonoBehaviour
{
[DllImport("__Internal")]
private static extern void ToggleIframe();

public void ToggleFrame()
{
    ToggleIframe();
}

}

with the following script in my (custom) webgl template (index.html) ```html
  <script>
    mergeInto(LibraryManager.library, {
      ToggleIframe: function () {
        var iframe = document.getElementById('iframe-element');
        if (iframe) {
          iframe.style.display = iframe.style.display === 'none' ? 'block' : 'none';
        } else {
          console.error('ToggleIframe: No element with id "iframe-element" found.');
        }
      }
    });
  </script>

and I get the following errors every time.. ```
Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js: undefined symbol: ToggleIframe (referenced by top-level compiled C/C++ code)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output:
error: undefined symbol: ToggleIframe (referenced by top-level compiled C/C++ code)
warning: Link with -s LLD_REPORT_UNDEFINED to get more information on undefined symbols
warning: To disable errors for undefined symbols use -s ERROR_ON_UNDEFINED_SYMBOLS=0
warning: _ToggleIframe may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
emcc: error: '"C:/Program Files/Unity/Hub/Editor/2022.2.5f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/node/node.exe" "C:\Program Files\Unity\Hub\Editor\2022.2.5f1\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emscripten\src\compiler.js" C:\Users\scott\AppData\Local\Temp\tmpg6rmczff.json' failed (returned 1)

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

#

I have tried everything.. If you guys have any pointers or any idea what the issue can be, let me know! Thanks in advance for the support!!

azure spruce
#

@unique hawk Use JSLIB. Create JS function at HTMl side and create JSLIB on unity side (under plugin folder). After that create fucntion to call it from jslib. Unity using emscriptten to communicate with JS.

azure spruce
unique hawk
delicate forum
#

Does anyone know how to make online game in browser with webgl?

plain shard
charred briar
#

!learn

somber questBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

haughty lynx
#

Hey! I was wondering if it's possible to share a link that would open the game in webgl redirecting directly somewhere. Like for example I'd share a link of the game url with an id "app.site.com/id" and reading the id from Unity and then do something in the game based on this id

arctic rose
haughty lynx
#

How would that work? Or is there an alternative of having an id in the url?

#

Oh okay I read wrong, so I could use app.site.com/?id=123, and then retreive this info via Application-absoluteURL?

arctic rose
#

yes

haughty lynx
glacial barn
#

The thing is, it's a very simple 2d game but the more objects I add to the scene, the more it lags on PC... it's bad

#

Profiler doesn't seem to show any problems performance wise. But it runs well on the editor

charred briar
#

I don't use URP, so I can't weigh in unfortunately

plain shard
glacial barn
#

right?

#

I have a low/medium end laptop (that's why fps are relatively low)

plain shard
# glacial barn Well seems like it's the shadows...

yes. shadows (1) are ordinarily submitted as jobs (2) webgl is single threaded (3) you probably want to use culling / limit the number of game objects your lights can illuminate, because this looks pretty excessive even for 4 lights

glacial barn
#

Are there any other solutions for this?

glacial barn
#

All shadows disabled

glacial barn
#

Ok the game actually runs at 60fps on the phone without the shadows lmao. previously it ran at like 15 fps

#

Are we sure this Shadow Caster 2D script is not actually poorly written by Unity? Is this really not a bug?

#

URP version 12.1.7

deft sandal
#

is it possible to save info to something like a password manager?
Anything that would trigger a "login" to save login info?

I was thinking that I could possibly hide a username + password input on the page, and just edit them manually with some js function every time the webgl inputs are changed.

but that feels super hacky.

plain shard
ashen matrix
#

My webGL built Users in Safari the ear speaker and Not the handsfree speakers. So it is too quiet 😦
How can i handle this? 😦

charred briar
glacial barn
#

Or does anyone know any "alternatives" / fake 2d shadows instead of Shadow Caster 2D?

plain shard
glacial barn
plain shard
charred briar
glass cloud
#

is there any way to access the clipboard on webgl?

#

the systemCopyBuffer doesnt work

#

and it seems like copy pasting in general is weird

high patrol
#

into a text mesh field? I don't think that's supported

sweet oriole
glass cloud
#

a button that just pastes the text into the game

#

it works in engine but not in webgl

glass cloud
#

im pretty sure thats referring to ctrlc ctrlv

sweet oriole
glass cloud
#

ill look into it thanks

hybrid sigil
#

webgl crashes when you exit a touch keyboard?

#

(both on ios safari and android)

hybrid sigil
#

how to fix?

hazy mural
hybrid sigil
#

2023.2.2f

#

ive decided to make a custom onscreen keyboard because there are also other issues with the on screen keyboard

hazy mural
glacial barn
#

Just an update on the Shadow Caster 2D performance issue:
I just gave up on it and made my own "fake" shadow caster, that's it...

#

looks good for my use case

#

it's not an actual shader, just creates a light 2d with the correct shape path

#

and it's possible to make it finite

main shale
#

even webgpu runs in 1 of 3 hardware accelerated in chrome/not yet opera - give a try check it out,
we mostly all can run webgl and optional webrtc in modern browsers and they can more see what is saw,
webrtc in udp instead tcp but no fast as good sample yet if anyone has it put it here please.
notice webgpu req updates and enabled flags adjust resoulution, before you also try this new xp:
also, if you have a new mobile device than my old smartphone that runs it give a icon here, thx.
https://boat-demo.cds.unity3d.com/ # it is rendered and calcualted in perfomant gpu not a video

errant cipher
#

So is there any way to get Cursor Lock working in WebGL for something like a third person camera. Where you right click, it locks, you orbit the camera around, then unlocks when you let go of the right mouse button. It always needs a second input from the keyboard or left click to actually lock which is not normal behavior.

errant cipher
#

For anyone trying to do cursor locking in webgl, the solution is to call into native js with a .jslib file in unity.
Jslib:

mergeInto(LibraryManager.library, {
  LockCursor: function (lock) {
    canvas = document.querySelector("#unity-canvas");
    if(lock){
        canvas.requestPointerLock();
    } else {
        document.exitPointerLock();
    }
  }
});

C#:

#if UNITY_WEBGL
[DllImport("__Internal")]
private static extern void LockCursor(bool @lock);
#endif
private bool _isCursorLocked = false;
[Conditional("UNITY_WEBGL")]
private void CallLockCursor(bool @lock) {
    LockCursor(@lock);
    _isCursorLocked = @lock;
}
main shale
#

right click, two fingers touch or esc or tab than on update check the key and call mouse pointer lock, just on build js file gets overwritten.

daring root
#

good afternoon, I got on this server since im looking for help with my first unity project. The colliders of my game are working correctly on the editor window but when i try to build they dont work, I tried debugging to make sure the colissions were detected and the collisions did log in. I made sure the player object and the walls were on the same layer and made sure an 2d physics that the collision matrix was in order.

lucid raptor
daring root
#

nevermind i found that the error was on the prefabs that I was using as tiles

lucid raptor
#

Nice!

plain shard
plain shard
languid pond
#

trying to upload a game for a gamejam but the music tracks sound crackly, the first one is in the editor and the second one is in the build

#

though the crackling only happens on 3 tracks that i have overlayed on each other to get an adaptive music system, does the volume changing cause this?

charred briar
#

I usually change the sound more subtly. Adding a volume as a target, and then slowly fading to that volume over time via an update or coroutine. That way it's a lot smoother with less spikes and it rounds off the unexpected peak changes. Depending on those stats that volume could change all over the place

tribal minnow
#

I'm getting this error when I upload the newest build to my website

#

RangeError: maximum call stack size exceeded

#

at invoke_ii (http:mywebsite.com/Build
web_build.framework.js.gz:3:371759)
at wasm://wasm/04d1fa46:wasm-function[5506]:0x18a4dc

#

any idea what's happening here or how to fix it?

vocal vapor
#

~~Any suggestions on this build-error?
My online search has only resulted in suggesting "something" is unsupported, but I can't identify what. (Perhaps I'm missing something in the error message?)

Build completed with a result of 'Failed' in 1941 seconds (1941457 ms)
Building Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js failed with output:
emcc: error: '"C:/Program Files/Unity/Hub/Editor/2023.1.20f1/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/binaryen\bin\wasm-opt" --strip-dwarf --post-emscripten -O3 --low-memory-unused --zero-filled-memory --strip-debug --strip-producers Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.wasm -o Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.wasm --mvp-features' failed (returned 2147483651)

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)~~

I think this was a local memory issue. I restarted Unity, built again - and it succeeded without changing anything.

elder warren
#

is there a way to check if my built game is running on a mobile device? or even better, check if the device has touch support?

#

I'm developing the camera navigation and it should be different on touch devices

elder warren
#

second question, is the UIElements better for webgl when compared to the uGUI?

vocal vapor
elder warren
#

I found a solution, I'm using InputSystem.GetDevice<Touchscreen>() to check if it exists

vocal vapor
vocal vapor
vocal vapor
#

Regarding WebGL issue, with UIToolkit... [If this belongs there, let me know]

Setup
Splashscreen loads a MainMenu scene with a UIDocument

MainMenu UI has a button that queues a scene to load, the LoadScene is done in Update.

The new scene loads, with its own UIDocument that has a button, that queues returning to MainMenu scene, also loaded in Update.

Problem
The MainMenu UI does not load when returning to it.
This only occurs when playing a WebGL build.
It does not occur in WebGL Editor, or in a Windows build.

Error
The only error that seems to happen around the same time:

InvalidOperationException: Stack empty.
at System.Collections.Generic.Stack`1[T].ThrowForEmptyStack () [0x00000] in <00000000000000000000000000000000>:0

Observations
Two notable variances:
#1) Build a UIDocument in my script in Start(), with AddComponent<UIDocument>() - The error occurs during that call.
#2) Have existing UIDocument, accessed in Start() with GetComponent<UIDocument>() - the error occurs before .Awake(). GetComponent will return a UIDocument; however, rootVisualElement will be NULL.
#3) One UIDocument on a different DontDestroyOnLoad() object, using this.uiDocument = different.GetComponent<UIDocument>() - The error occurs during uiDocument.panelSettings = this.panelSettings.
#4) One UIDocument on a different DontDestroyOnLoad() object, like #3; however, this time not overwriting the settings/asset, instead .Add() to the existing root. - The error now occurs during menuUI.visualTreeAsset.CloneTree();

vocal vapor
hallow sequoia
#

@vocal vapor Are you still working on this? Can you share the entire stack trace where you pulled InvalidOperationException: Stack empty. at System.Collections.Generic.Stack from, if so?

vocal vapor
# hallow sequoia <@200416434776440832> Are you still working on this? Can you share the entire st...

I very much am still working on this... for three days now x.x
I tried recreating it in a brand new scene, but wasn't able to. So... it's got to be something I'm doing, somewhere.
I've taken to copying the entire project, and am slowly ripping out every component to try and narrow down the culprit.

https://pastebin.com/GsmCSUcX - I didn't want to paste it here, it's a lot.
[Or alternatively, let me know how else I should paste large content]

#

What's really fun, now, is the latest version I'm testing...
I can go into the game, then back to the menu, 3? times, give or take. Before it does the breaking (as earlier described)

hallow sequoia
#

I've taken to copying the entire project, and am slowly ripping out every component to try and narrow down the culprit.
Good idea to try and isolate the issue from the rest of the project.

I can go into the game, then back to the menu, 3? times, give or take. Before it does the breaking (as earlier described)
My intuition is wonder if there is a memory leak somewhere...? Especially if the issue doesn't show up until something happens after a certain point.

vocal vapor
hallow sequoia
#

I just need more time to continue widdling it down
I'd say you should be building it up instead. Presumably you'd be able to easily add the elements in an empty project to know if the scene transition mechanism.

You should probably use the webgl profiler too; though, I haven't used the profiler on a webgl project (yet). I have used in the editor and on desktop applications.

vocal vapor
hallow sequoia
vocal vapor
#

To me, at least - It's a lot easier to prove the issue is still happening, after removing things - than it is to spend time adding things, not knowing if what you added will be the break.

#

Memory Profiler showed pretty consistent ~452MB, so if it's a leak, I don't think it's significant enough to be the issue of taking too much. Unless there's an accessor happening somewhere (which is my lean towards a missing event unregister)

charred briar
#

It's probably important to mention memory works different on webgl as well. As garbage collection can't happen immediately, it happens on the next frame. So even a lot of json/linq string requests can build up a crazy amount of ram between frames

vocal vapor
#

I think I finally got a clue, with a new error message around the same location:

InvalidOperationException: Failed to Free handle with Index=0 Version=0

This new error lead me here-
https://forum.unity.com/threads/1391191/
Which has a link to another bug report, which further has more links.

I think this might be the bug I've been fighting for the past 3 days.

Though one of my tests, did leave the root UXML, and only added/removed elements. So I'm not 100% certain it's the same thing; but, it's a big clue.

weary wasp
#

Hey guys, with a WebGL build is there a way to interface with the website code?
I've used a .jslib file but I want to import functions from javascript that is included with the website
outside of the Unity build.

arctic rose
#

just call the functions

#

The functions you want to call must be in the global level

worthy pier
#

🆘 🆘 🆘 Help 🆘 🆘 🆘
anyone have suggest unity webgl ar plugin Free and some one time purchases asset plz help me

charred briar
#

Personally I prefer WebAR to not go through Unity though. Much easier and lighter to work through typescript m

weary wasp
#

The functions you want to call must be

vocal vapor
# vocal vapor Regarding WebGL issue, with UIToolkit... [If this belongs there, let me know] ...

I finally found the "smoking gun" culprit that changes "make it or break it" in my situation:
SceneManager.LoadSceneAsync() - This will eventually break UIToolkit. Even if the old scenes are being unloaded.
SceneManager.LoadScene() - This, as of yet, does not.

When building my day-1 reproduction test, I accidently used LoadScene, which was a deviation from my actual project code. Resulting in a sort of 'false positive'.

Granted, the issue is not specifically related to SceneManager - just, that is a key component to reproduction.

If anyone wanted to see the issue for themselves, I made this during my testing (and looking for potential workarounds).

https://github.com/BadgerMeles/Unity-WebGL-UIToolkit-Exception

hallow sequoia
vocal vapor
hallow sequoia
vocal vapor
#

Yeah. My current workaround will be to just use LoadScene instead of LoadAsyncScene - which will require reworking some things, so I can quickly load a "nearly empty" scene so it loads as fast as possible. (Otherwise the music "freezes" when not Async). Then just turn things on once the new scene is loaded, and has its own music/sfx going.

hallow sequoia
#

e.g. do you get an "index out of range" if you wait 0.2 seconds after loading a scene to then access..?

vocal vapor
#

I've never seen the Index Out of Range error.
But my tests do have an example that delays loading/setup the UIDocument after the scene loads - and it still throws the Exception. So, not a solution.

crude marsh
#

what is easiest way to Fetch Session Storage Key value from WebGL build
currently facing few errors, any help is appreciated

arctic rose
#

Show the code and the error

crude marsh
#

manage to solve the issue using some GPT

getFromSessionStorage: function(str){
var keyName = UTF8ToString(str);
var returnStr = sessionStorage.getItem(keyName);
var bufferSize = lengthBytesUTF8(returnStr) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
}

as i am very new to JS this was code that was added to JSLIB inside plugin folder

this is implementation is for getting data for SessionStorage

rare quail
#

Hi, Can i use microphone in webgl?

plain shard
turbid topaz
#

Hi!
Can someone help figure out performance issues on iPhone? (WebGL project running in browser)
The issue seems to corelate with UI updates. Lately there have been some new features in our project and those added a couple new buttons to the main UI Document of the project. Since then the game glitches and crashes after click events, most commonly - those that call back to JS (the project has a web component too), but sometimes - even after clicking a button that just opens a UI window.
The problem occurs on iPhone XR (iOS 17, Chrome ver 120.0). Also checked on Google Pixel 3a (Android 12, Chrome v 120.0), but it ran smoothly there.

elder warren
#

Hi, I'm having a problem with UIToolkit input field when building for webgl and using full screen

#

the mobile keyboard is not showing up to type the input value

#

it works as intended if I'm not on full screen

#

is it a known issue or something? I can't find anything on the web about it

elder warren
#

The ui input field appears behind the canvas when on full screen

elder warren
#

another question, in the unity default template they have this code to detect if it's a mobile browser and make the canvas fit to the whole page, but somehow my ipad is not being considered a mobile device here

#

any idea on how to solve it?

#

this is my user agent on the ipad safari Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15

#

hmm, it was a setting on ios, I wonder if it's the default value

brazen niche
#

Hey guys, I'm making a simple multiplayer project using WebGL and Mirror Networking. I want users to connect from a WebGL client in a browser to my server hosted on AWS. I've tested that my local WebGL and Unity builds can connect to the AWS instance IP but my WebGL build hosted on Unity cannot. Is there an obvious step I may have missed? Does Unity block multiplayer connections on their hosting?

Edit: In case someone else has a similar issue and comes across this. I found out the issue was that I was trying to use an insecure websocket connection from a secure HTTPS page. I can get around this either through setting Google Chrome's site settings to Allow insecure content, or through setting up a reverse proxy as described here: https://mirror-networking.gitbook.io/docs/manual/transports/websockets-transport/reverse-proxy

glacial barn
# elder warren The ui input field appears behind the canvas when on full screen

Well, if the canvas is in fullscreen it overlaps any other element on the html, that's how it works. Previously I think you could bypass that by setting the z-indez high in the other elements you wanted to overlap, but browser don't allow that anymore.
I think you could try to put the canvas and the other elements inside a div and then requestFullscreen on the div. And make the canvas width and height 100%, but not sure if that works

elder warren
#

what you suggested don't work

#

what kind of worked was to make the document.body request full screen

#

but it didn't work very well on my ipad

#

that's why I created my own keyboard

high patrol
#

Checking -- you can get a local webgl build running in your browser?

plain shard
# elder warren that's why I created my own keyboard

@hazy mural unity is really shy about documenting the limitation with keyboards on mobile devices.

the following is impossible to ever create on mobile safari:

  1. start with no native keyboard on screen in mobile safari
  2. the user taps a canvas element anywhere in the page.
  3. the native keyboard appears.

i understand that it is challenging to communicate to developers. they're going to get the takeaway that you cannot do text input on mobile safari with webgl. that is indeed true, you can't. it sounds like unity has decided it does not want to create a keyboard component, so that's 100% true.

plain shard
#

what role does your server hosted on AWS play?

plain shard
#

it has been the case for at least 5 years

elder warren
#

I actually found a way to detect it's an ipad

plain shard
#

i mean of course it is possible

elder warren
#

using the number of touches

plain shard
#

to heuristically determine if something is an ipad, you can of course directly determine it has a touchscreen. but also, you should be using input system and pointers

#

then it doesn't really matter

plain shard
turbid topaz
turbid topaz
main shale
tulip drum
#

I think the new chrome update created a bug with webgl. TmproUGUI elements are flicker/disappearing, on other chromium based browsers it works fine.

nocturne timber
#
Unable to parse Build/Build1.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.```
#

guys when im building my webgl I get this error on opening it

#

what can be the problem

charred briar
#

It's telling you to disable gzip in the build settings.

nocturne timber
nocturne timber
#

thankyou

broken plank
#

Greetings,

I'm experiencing a mixed content issue in my Unity WebGL project when hosted on a web server with HTTPS. I'm using the "Netcode for GameObjects" package to handle networking. While the project functions seamlessly on a local web server, attempting to deploy it to an HTTPS-enabled server triggers an error:

An insecure WebSocket connection may not be initiated from a page loaded over https

I'm aware that this indicates the need for a secure connection, but I've been unable to find specific instructions on how to achieve this within the "Netcode for GameObjects" package.

Has anyone else encountered this challenge? If so, how did you manage to overcome it?

And let me know it it belongs on the #archived-networking channel.

fast linden
#

hey

#

oops

#

wrong chat

high patrol
#

you can try connecting to the http: version

#

or you can try your hand at certificate signing

broken plank
high patrol
#

does that give you an ssl self signed cert error?

broken plank
limpid ocean
#
    private string mSaveDataPath = "saveData.json";
    string fullPath;

    private void Awake()
    {

        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        mPersistentDataPath = Application.persistentDataPath;

        fullPath = Path.Combine(mPersistentDataPath, mSaveDataPath);


        if (File.Exists(fullPath))
        {
            LoadGame();
        }
        else
        {
            Debug.Log("No save data found in " + fullPath);
        }
    }

    public void SaveGame()
    {
        Debug.Log("We are saving the game in path " + fullPath);
        // we write the file will not include in discord
        string json = JsonUtility.ToJson(saveData);
        //File.WriteAllText(fullPath, json);
        StartCoroutine(SaveGameUsingWWW(json));
    }

    private IEnumerator SaveGameUsingWWW(string json)
    {

        // Use UnityWebRequest to save the data
        using (UnityWebRequest www = UnityWebRequest.Put(fullPath, json))
        {
            yield return www.SendWebRequest();

            if (www.result != UnityWebRequest.Result.Success)
            {
                Debug.LogError("Failed to save game data: " + www.error);
            }
            else
            {
                Debug.Log("Game saved successfully.");
            }
        }
    }```

I dont understand why my path is not found and returning Failed to save game data: HTTP/1.1 404 Not Found when the idbfs/Game is in my storage in F12 in firefox
Can someone help please?
cerulean schooner
#

Does anyone know why my webgl build is not working. I tried turning off the compression format and then building. I'm unsure what the errors mean.

arctic rose
#

Show the full error messages

cerulean schooner
#

the full image would show

arctic rose
#

Those aren't the full errors. When you click on them the full error shows below

cerulean schooner
#

alr

#

should i upload all the texts?

#

there are a lot more

arctic rose
#

go through the suggestions there

#

Seems like unicode characters in jslib files cause it, if you have those it's an easy fix, if they're in assets then not as simple

cerulean schooner
#

alr

cerulean schooner
#

my onedrive desktop folder's name is in another language

#

so im trying to change that

#

im not sure how i will manipulate the jslib files

#

or where to find it

#

so ill work on fixing the onedrive folder first

#

and then searching up how to change the jslib file if the onedrive solution does not work

#

It works!

#

thank you

#

the link pointed me in the right direction for solving the errors

main shale
# arctic rose go through the suggestions there

what problem/solution json serialisation- utf8 not utf16 in uniycode, not custom- speical characte at begin BOM, and new lines are diffrent, from windows, mac, newMac, Unicode, Unity /n ( if Json library: JsonUtility.FromJson<MyClass>(json); ecma /n is linefeed, is right than shoud read and configure with parameters, Utf LE/BI (indians) and feature Convert To Utf-8 LI BOM NewLine Default , optional convert on Read (fix /n/r to /l .. remove BOM) Ansi Character Set a Lot more) filter paraghraph git on target unicode conversion: json utf8 noBom /n linefeed https://en.wikipedia.org/wiki/Newline

A newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a sequence of characters, is used to signify the end of a line of text and the start of a new one.

neat agate
#

do AudioClips work with Addressables + CCD in WebGL? I cant manage to load them without errors

high patrol
#

Addressables does support WebGL. Local addressable assets are stored in the Application.streamingAssetsPath.

It sounds like you are running into InvalidKeyExceptions, did you build Addressables (in the Addressable Groups window toolbar > Build > New Build) before building the player?

neat agate
main beacon
#

HELP GUYZ

#

I tried everything and always get this error

main beacon
#

There's no Solution?(?

main beacon
#

looks like nom

main beacon
#

Ok just Turned off antivirus .

orchid bridge
#

Is anyone planning to make games for webgpu? I mean specifically aiming for mobile&web market, and betting on the performance boost?

high patrol
#

#🌐┃web might need to be renamed to infer webgpu as well. I'm excited but feel it's going to be a few years before anything comes along to convince me to develop seriously for webgpu

#

Think unity's still waiting on specs from google on some of that stuff

sweet oriole
# high patrol Think unity's still waiting on specs from google on some of that stuff

WebGPU’s specification has recently reached version 1.0, and active development is still ongoing. WebGPU is enabled by default today in Google Chrome on ChromeOS, Mac and Windows, and in Chrome Canary on Android.
https://forum.unity.com/threads/early-access-to-the-new-webgpu-backend-in-unity-2023-3.1516621/
It's happening right now. WebGPU isn't quite there yet for Firefox and Safari. Mobile seems to be a bit more fragmented, but having solid desktop support would be a good start.
https://caniuse.com/webgpu

lucid raptor
#

Anyone have a good resource for hosting a webgl game like diep.io with ads? I don't need it to be multiplayer

rare quail
#

Hello, I used Game Server Hosting (Multiplay), but when I want to build for webgl, I encounter these errors. While I build for other platforms, I do not encounter these errors.

willow hamlet
#

Does anyone know why the WebGL Wasm file is not caching in the browser, it keeps on redownloading again and again. My wasm file is 55 Meg and it's crazy for people to have to redownload each time.

arctic rose
#

Caching is (mostly) determined by the headers sent by the server

sweet oriole
sweet oriole
main beacon
#

GUys why the hell the old cached webGl game is loading instead updated file 😭😭😭

#

So i need to generade New site for that!!!???

#

Is there any way to Fix that

glass kite
#

is there any workaround to WarpCursorPosition()? This unresolved Unity thread from last year points out that it doesn't seem to work in webGL ("From the docs : 'On desktop platforms (Windows, Mac, Linux, and UWP), you can move the mouse cursor via code.' Implying that it is not possible in WebGL via Code)
https://forum.unity.com/threads/forcing-mouse-position-in-webgl.1239901/

#

player movement in my game is tied directly to the mouse position, and WarpCursorPosition() was how I was fixing a glitch wherein the player would pause, move their mouse to the pause button, and then the player would "teleport" to the new position on screen. Unless I can fix that in webGL I'm worried I may have to scrap the entire prospect of uploading it through webGL, which would suck cause I really want recruiters to actually play this (and from what I've heard they rarely if ever bother to download anything)

sweet oriole
# main beacon Is there any way to Fix that

Changing file names is the most straightforward and reliable way to bust caches (of browsers and CDNs). Unity renames files for you if you enable "Name Files As Hashes" option in WebGL player settings.

sweet oriole
glass kite
main beacon
#

Im just gonna use different less broken website.

glass kite
#

is anyone else able to access itch.io at the moment? Every time I try to load I get "there was an error with your request"

#

and if itch is in fact down (rather than an issue on my end) does anyone have recommendations for other sites where I can upload and test a webgl build?

brittle notch
#

Hi. I am having a Unity WebGL project and my prototype works on localhost. But after I released it to my server I cant connect via websocket. I can use a java client and connect to my websocket backend but I cant connect via WebGL. Is that a certificate issue maybe? Any advice on this? I have no iptables rules, dont use CORS and nginx rerouting should work fine as the ssl certificate seems to be working with my java client. Any tips are welcome. I asked in #development beginner chat but was told to ask here.

sweet oriole
glass kite
brazen niche
brazen niche
brazen niche
# brazen niche Hey guys, I'm making a simple multiplayer project using WebGL and Mirror Network...

Mirror Networking uses port 7777 by default and I opened this port on AWS EC2 security rules and on Windows inside the AWS instance (My host). Maybe the issue is that the Unity WebGL game hosting (My client) would need to open port 7777 outbound but I have no way to control that?

Edit: the client does not need to open an outbound port, the issue was that I was trying to use an insecure websocket connection from a secure HTTPS page. I can get around this either through setting Google Chrome's site settings to Allow insecure content, or through setting up a reverse proxy as described here: https://mirror-networking.gitbook.io/docs/manual/transports/websockets-transport/reverse-proxy

lucid pelican
#

Hi all, I'm attempting to run an WebGL build of my project, but on 'Build and Run' the web browser launches and locks up. This means I can't open the javascript console to start debugging the issue, which is the Unity docs recommendation of how to proceed.

My file size is ~20mb, which seems reasonable? I can only assume performance is poor in other areas of my game.

Does anyone have another method of getting logs? Perhaps I should load this only a local IIS server and turn on all the logging options? Any help would be much appreciated.

Edit: I've tried Edge and Chrome, but both have the same issue. My game is published to Itch here, [REMOVED LINK]

arctic rose
#

Is that the version that locks up for you?

lucid pelican
#

I'm using 2022.2.20

arctic rose
#

I mean if you open the itch.io link yourself does it lock up, or does it only happen when you build & run from the editor?

lucid pelican
#

Ah, it happens in both cases, and I've sent the link to others who have experienced the same problem

arctic rose
#

It doesn't happen to me

lucid pelican
#

Well that's good news!

arctic rose
#

I'm guessing the shader errors are more severe in other computers

lucid pelican
#

Thanks for the error messages, that gives me a good place to start!

strange escarp
#

Hi

#

Who know the wy the button not working when i clicked in the button?

main shale
# strange escarp

what git / page you have or the source to find the bug (webplayer could end if error)

proven silo
#

Hello everyone!!!
Does UNITY have any project samples or start guide on how to build a game/app using WEBGL?

random talon
#

I'm having some issues making a webgl app compatible also for mobile devices, specifically iPhones, do you have any suggestions or guide to share about that topic?

vernal hornet
#

I asked this in one of the coding channles but it fits hear aswell

#

in one my my projects I am using a the google sheets api. This uses google authentication api which uses Newtonsoft.Json. My project throws the provided error when build with webgl when ever a google sheets api call is made. Through research I have determined that this error is caused by AOT. following this guide: https://github.com/applejag/Newtonsoft.Json-for-Unity/wiki/Fix-AOT-using-link.xml I created a link.xml file and included it in my assets folder. here is the contents of my link file ```xml
<linker>
<assembly fullname="AssemblyCSharp">
<type fullname="usesJson.handleLogin" preserve="all"/>
<type fullname="usesJson.USER" preserve="all"/>
<type fullname="Google.Apis.Auth.OAuth2.JsonCredentialParameters" preserve="all">
<method signature="System.Void .ctor()"/>
</type>
<type fullname="Google.Apis.Auth.OAuth2" preserve="all"/>
<type fullname="ewtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject" preserve="all">
<method signature="System.Void .ctor()"/>
</type>
<type fullname="ewtonsoft.Json.Serialization.JsonSerializerInternalReader" preserve="all"/>
</assembly>
</linker>

GitHub

Newtonsoft.Json (Json.NET) 10.0.3, 11.0.2, 12.0.3, & 13.0.1 for Unity IL2CPP builds, available via Unity Package Manager - applejag/Newtonsoft.Json-for-Unity

turbid topaz
#

Hi!
I was looking into a memory issue with a company project (WebGL) that was only occurring on iPhones and I think I might have stumbled into a memory leak on the WebKit side of things. Since I can't really visit random webGL projects from a company MacBook/iPhone, I would like to request some cooperation on double-checking that the issue is indeed webkit-related and maybe some help submitting an issue to the webkit bugzilla if it is indeed an issue on their part.

Now, a bit about why I think it is a WebKit issue as opposed to a memory leak in our app:

  1. Taking multiple memory snapshots (after load, 5, 10, 15, 20 minutes later) using unity memory profiler from an autoconnected development build didn't indicate any memory leaks
  2. The gradual memory usage increase (particularly - the part that Safari devtools labels as "Page") is observable both in our company Unity WebGL project, and 2 other company PlayCanvas projects
  3. Noted memory usage increase doesn't seem to be related to the safari profiler itself, since the increase is not present on regular web-pages (html, css)

I will start a thread for this and attach 2 10-minute recordings from Safari devtools timelines to illustrate the issue. Any help checking / comfirming the issue would be greatly appreciated.

cyan kraken
#

hello, i have a simple very empty project with a single scene
i click on that button and it works as expected

but when i make a build it to webgl, the button no longer works
it does not even blink when i click on it, as if my mouse and keyboard inputs are not reaching the webgl
any idea what the issue might be, because it's working as expected in the editor

charred briar
#

And keeping in mind you need to click on the canvas first to make sure it's active.

cyan kraken
# charred briar I'd start by checking the browser console for error messages (f12)

no error in console
so
I tried two things
1.
i added a TMP text in a corner and gave it input.mousePosition value
In WebGL build, the value stays fixed even if i move the mouse around, or click inside the canvas
2.
instead of using 2022.3.4f1, i switched to 2021.3.4f1, make the same setup, built, and this time the clicking worked

#

from the input, the mouse cursor seem stuck at bottom center of the canvas, and wont move no matter where i click
in 2022.3.4f1

random talon
#

I'm getting black screen after the initial Unity load if running a webgl app on mobile, is there any specific reason for that?

#

The are the 2 main warnings I get

solar hound
#

I making game in webgl and I update my game to my server but i have one issue with browser cookie, each time I made an update to server I have to clear cookies to see my new update how can i solve this issue, I want it to update immediately without need to clear cookies. please help!

sweet oriole
solar hound
#

@sweet oriole I just change version code in index.html and it's works for me but in some pc i required to hard refresh in-order to get latest updates

sweet oriole
little panther
#

Hi, I was facing difficulty when trying to implement Unity Relay on WebGl build it keeps giving me this message, please any guidance would be greatly appreciated

sweet oriole
little panther
#

well what you are saying sounds about right but I was following unity's official documentation for cross-play

little panther
sweet oriole
little panther
#

well to be specific, I am using Mirror, with Unity relay to perform Cross platform on PC and Webgl builds but since I am having difficulty understanding the issue and couldn't find much on google or any of forum I came here, I am am using a git repo which was a mix of both Mirror and Relay but it is not working for the Webgl build which is my biggest concern since Cross platfrom is a must for me.

sweet oriole
little panther
#

this was also written before this

sweet oriole
#

https://mirror-networking.gitbook.io/docs/manual/transports/multiplex-transport

A common use case for the Multiplex Transport is a server listening for both WebGL and mobile / desktop clients. Your WebGL clients can connect to the server using a Websocket Transport and your mobile or desktop clients can connect to the same server via TCP or UDP transports. You can configure any number of transports in the Multiplex Transport.

little panther
little panther
sweet oriole
#

There are some potential issues with something like Mirror in a peer to peer over relay type of configuration, namely with the host dropping out

#

Unless Mirror supports host migration now

little panther
#

I wasn't exactly facing the issue of host dropping more like client on the webgl build not being able to connect with the host on another pc build.

sweet oriole
#

Yea I was just mentioning it, since I'm not sure if you have thought what happens when the hosting client drops out. Hosts need to port forward if there isn't some other mechanism to do it for them or bypass it (like a relay).

little panther
#

do you mean when the host client drops out and causes the session to end ?

sweet oriole
#

Yes

little panther
#

no that bridge i'll cross later currently my biggest problem is Webgl not connecting with the host client

little panther
# sweet oriole Yes

can you give me alternative to do this, which is doing cross platform, with Webgl (specially) with multiplayer functionality and be able to connect anywhere around the world.

sweet oriole
#

For a managed peer to peer over relay setup I would historically go for Photon PUN, but that has not been replaced with Photon Fusion. I imagine it also works well for this, but I haven't checked it out and I'm pretty sure it's a bit more complex (with better results tbf).

#

Nowadays my alternative is to just not build multiplayer games without dedicated servers, since there are very few types of games where that's actually the ideal solution 😄

little panther
#

but doesn't Unity Relay helps out with the dedicated server part problem ?

sweet oriole
#

Relays help to avoid the setup of forwarding ports for receiving connections, but it doesn't automatically make sure all state/data is kept on all clients so anyone can take over in case the "host" drops out.

#

I believe Photon Quantum demonstrates a more "hostless" peer to peer setup, but that's another can of worms in practice when you look at what Photon Quantum is doing.

little panther
#

I guess Photon Fusion it is. Thank you for the guidance.

charred briar
#

I'd second using photon, it's what we use

random talon
#

I'm trying to make a WebGL playable on mobile devices, previously I used WebGL 2.0 and it went ok on Androind but on Iphones the page crashed for some reasons.
Now I'm trying with using WebGL 1.0, it opens on both devices and it runs cause I can see the audio be on both phone I have blackscreen.
Do somebody know what could be the issue?

#

(I've used Unity 2022.3.11)

main shale
main shale
random talon
#

Also does somebody knows if and how its possible to call methods of a unity webgl app from the browser console?

charred briar
#

so, via console, you could use Instance.SendMessage

random talon
charred briar
#

It's the context in javascript when you create it

random talon
#

(sorry for newbie question but I'm not the guy who made the page so I'm trying to understand what is my part and what is not)

ionic spire
#

For my WebGL game I have an IPreprocessBuildWithReport class that generates some data about the build. It then saves this data as json to a build-info.json file under Assets/Resources. When I run the game in the editor, I load the file and display some info on the start screen (build time stamp, git hash, etc.).

I'm loading the json like this (during runtime):
var json = Resources.Load<TextAsset>("build-info").text;

And saving it like this (this runs when making the build):
File.WriteAllText("absolute/path/to/Assets/Resources/build-info.json", json);

My problem is that this does not appear to work at all in a build (itch or local). It works fine in the editor. Any idea what I am doing wrong? I found this documentation about webgl resources but I don't think it is relevant: https://docs.unity3d.com/Manual/webgl-embeddedresources.html

EDIT: I'm going to run with a scriptable object version (just a regular .asset that I update before a build) because that seems to work.

high patrol
#

I don't think you're allowed to just access any file willy nilly when contained in the browser

File.WriteAllText("absolute/path/to/build-info.json", json); might need to be changed to point to someplace you know you have access to, like Lgk said with playerprefs maybe

#

Are you sure the UIElements label is failing in the constructor? Or is it failing somewhere else?

ionic spire
high patrol
#

oh derp that's right. Well the path you're writing to may be restricted. Where does it path to?

high patrol
#

You are not allowed to write into the resources folder. Use PlayerPrefs or Application. persistentDataPath

ionic spire
high patrol
#

Interesting, I ran some tests and you're right. You may need to verify that the path is valid though

weary wasp
#

Hi guys, whats the best way to capture audio and vidoe in a WebGL build? I want to be able to output an mp4 file with audio and video, so far I've used a couple assets from the asset store that only record video well but not good for producing an mp4 with audio as well.

solar hound
#

How can i setup google signIn in unity webgl build, there are documentataion about android and ios with unity but not for web+unity

random talon
weary wasp
random talon
#
  script.onload = () => {
    createUnityInstance(canvas, config, (progress) => {...}).then((unityInstance) => {
      myGameInstance = unityInstance;
      …```
Can somebody help me implement this in the index.html?
random talon
#

nvm I've probably solved, but wonder if there is a way to somehow automatically include it in the build to avoid having to edit the index.html everytime after I do a build

charred briar
#

But yes, you can and should create your own WebGL templates and use those

#

That way all your classes don't have Unity in the naming, and a bunch of Unity logos on your loaders and throughout.

random talon
charred briar
random talon
#

I'll try to read documentation about custom templates

charred briar
#

You can basically copy their existing templates and modify them. But the infos in the docs and pretty decent on the subject

random talon
#

btw I'm happy that I made it work by myself (maybe is easy af but I have poor knowledge outside the Unity environment)

charred briar
#

Awesome!

weary wasp
clear grotto
random talon
main shale
random talon
main shale
random talon
main shale
random talon
#

and in that case another guys is doing the app while I'm prepping the webgl to deliver to him

random talon
#

I'm having issue when trying to load a webgl app on mobiles, the app load (I can hear the audio) but I get a blackscreen on video
I've excluded all the "harmless errors" and I came down to this one:
GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is incomplete: Attachment has zero size.
can somebody help?

#

Also I've noticed that on another site where the WebGL app is embedded it has no blackscreen error, so can I assume that its an issue on how the app got implemented in the website?

solar hound
little panther
#

I was having difficulty implementing the stateAuthority funtionality in Photon Fusion 1, for a VR network object while I was doing that I realized why isn't a lot of the things in fusion not automated and rather have to be done manually? or is there any easier plug and play method?

charred briar
ionic spire
eager grove
#

I have a 3D project that I want to export to WebGL. In the current build it works on computers and android phones. The only iphone it works on are 15/15 max. Can anybody help me problem solve? The goal is to get a build that works across computer and mobile. I'll make it worth your while. Let me know, Thanks!

sullen tiger
#

I've been searching for a few days now trying to fix this issue.

I am unable to export to HTML in Unity. I get like 20 of these errors, even with a blank project.

System.ComponentModel.Win32Exception (2): No such file or directory
at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Unity.IL2CPP.Shell.SetupAndStart(ExecuteContext context, Boolean asyncMode) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 423
at Unity.IL2CPP.Shell.ExecuteAsync(ExecuteArgs executeArgs, IExecuteController controller, Boolean asyncMode) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 299
at Unity.IL2CPP.Shell.Execute(ExecuteArgs executeArgs, IExecuteController controller) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Shell/Shell.cs:line 355
at Unity.IL2CPP.Building.CppProgramBuilder.ProvideObjectFile(IntermediateObjectFileCompilationData data) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/CppProgramBuilder.cs:line 334
at Unity.IL2CPP.Building.ParallelFor.<>c__DisplayClass1_0`2.<RunWithResult>b__0(Object o) in /Users/bokken/build/output/unity/il2cpp/Unity.IL2CPP.Building/ParallelFor.cs:line 78

Any ideas? Im using Unity 2020.3.26f1

sullen tiger
#

Using the newest Unity Editor solved this issue 🙂

charred briar
eager grove
#

If anybody thinks they can problem solve it let me know I’ll make it worth your while

somber questBOT
charred briar
#

I'd start by looking at the device / console logs. But I'd suggest posting the exact unity version, the errors in the console itself, etc. It's possible it's either running out of memory, or something simple like disabling auto graphics. But the log will take you there. Without the log or profiling it's just random guessing.

#

On the second topic @eager grove you need to go to the forums for hiring etc. Links to above.

charred briar
# random talon I'm having issue when trying to load a webgl app on mobiles, the app load (I can...

I'd try and make sure you have the latest version of unity. I believe 2023.x is when they began adding mobile support. I'd try disabling auto graphics and forcing it to a lower opengl just as a test step. It sounds to me like a mobile css issue though... I'd suggest trying to run Chrome or Firefox in mobile layout and see if that causes the same problem. If so, at least now you can use the inspector and see what's happening with the html - checking the canvas exists etc.

#

In those cases it's also worthwhile to do a micro test build (empty unity project) just to make sure it's not a issue with the builds - and without needing to wait for long build periods.

charred briar
eager grove
#

Here’s the console log from an Iphone8 on Safari. Unity version 2023.1

eager grove
eager grove
charred briar
#

Without the shader working it won't be able to draw things. It looks like it's using HDRP which I believe just won't work on webgl for mobile. But I'd force it to use OpenGL 2.0 (right now it's failing with 3.0). But I'm doubtful about HDRP on mobile over webgl 😦

eager grove
random talon
# charred briar I'd try and make sure you have the latest version of unity. I believe 2023.x is...

I kinda solved, since even a blank scene would get me a black screen I then tried a fresh new project and that same blank scene worked so the issue was within my project.
I basically exported all my scenes in a new project and the issue was solved, even using the same Unity version.
Maybe I had some bad unused asset that somehow still generated issues.
Now both android and iOs works with WebGL 2.0, the only thing I have to change exclusively for iphones is the color space, somehow i still get blackscreen when iphones open a Linear colorspace app, so for that instance I switch to gamma which is a bit uglier but a fair compromise

#

In that case I wonder if therese a way to automate a build outputting 3 versions:
-Linear colorspace and DXT texture compression (PC)
-Linear colorspace and ATSC texture compression (Android + Tablets)
-Gamma colorspace and ATSC texture compression (iOs)

glass kite
#

will platform dependant compilation still correctly identify mac vs windows if both builds are running in webgl?

stoic scroll
#

you're building you game for WebGL, not for Windows or macOS

#

so I would expect the answer to be no

glass kite
#

hm damn

stoic scroll
#

i thought you were missing compute shaders there

charred briar
glass kite
#

I'm trying to adjust my mouse sensitivity and I'm noticing the ranges are wildly different depending on whether it's run from mac vs windows

#

that might just be editor dependant and I'm curently building it to run in webgl to check but I was hoping I might be able to define separate ranges for each platform

stoic scroll
#

Definitely check how the build performs.

charred briar
stoic scroll
#

I know that scroll wheel input is often messed up on macOS when people ignore the magnitude of the scrolling

#

the trackpad on a macbook sends lots of tiny scroll events

#

but that's unrelated to mouse input

solar hound
#

Hi Friends, In webgl build i can not paste texts I copied from another tab or outside from my webapp, how can i paste text into inputfields?

charred briar
random talon
#

I need to call a JS function inside the index.html but I read that application.externalcall is deprecated

#

what is the current alternative?

random talon
#

I made the jslib now I only this part of syntax

arctic rose
#

That's where you call the function you want

random talon
#

so I have to do this : Android.functionName(paramter) can I just putt it where the ??? are?

arctic rose
#

Yes, that's where you put the JS code that you want to run

random talon
#

ok thanks

#

oh, one thing

#

I have a block of code that want to include in the index.html (its purpose is to create a unityInstance)
Is there a way to somehow automatically include it in every build? Cause for now I have to manually write it inside the index everytime I do a new buildl

arctic rose
#

Put all that in the jslib

random talon
#

oh that too?

#

and how can I execute it on start?

arctic rose
#

Oh right, that's not the function you're calling from the jslib. Forget that, it won't work then

random talon
#

so I'll have to manually put it inside each build...

arctic rose
random talon
#

Yeah I've read that plan B would be to make a template for seems a bit too complicated...

arctic rose
#

How is that complicated?

#

You copy the default template and add your script there, which is exactly what you've been doing so far after every build

random talon
#

ok then I'll try

random talon
#

BRUH that was dead simple

#

Idk why I got scared of that atwhatcost

#

Now I'm using Minimal, next step is to take standard as bade and cut everything except the loading bar

hazy blade
#

I'm planning to develop a web game but a critical part of this project is the accessibility with the WCAG 2.2 guidelines. Anyone had test that and know if Unity is a good game engine for this purpose? Because I found that there are alredy some Unity addons for that purpouse but I don't know how good they work. I mean if I export it to web using HTML5 all the buttons and object will be accesible with keyboard, screenreaders can obtain the text from the buttons and menus, the screenreader works properly and all this. At the moment I'm just comparing different game engines and I think Unity is my best option. Thanks beforehand

brazen niche
#

Issue resolved. Solution: I needed to use the FQDN to connect (example.com) rather than the IP (123.45.67).

Hey guys, I'm making a simple multiplayer project using WebGL and Mirror Networking. I want users to connect from a WebGL client in a browser to my Windows server hosted on AWS. I was able to connect but I needed to allow insecure connections in chrome since there wasn't an SSL cert so I registered a domain, set up a reverse proxy using IIS on the server, and an SSL cert on the server following the mirror guide: https://mirror-networking.gitbook.io/docs/manual/transports/websockets-transport/reverse-proxy/windows/iis. On AWS I set the domain to redirect to the IP of the EC2 server. When I enter the domain in the browser it will load the WebGL game client. When I use the EC2 instance IP to connect to the server (hosted using a Windows build) it doesn't connect. Usually an incorrect IP will say "connecting..." for a while but this will instantly stop trying. I have also tried with the ports, with the domain name etc and those say "connecting..." for a while and then nothing happens. Does anyone know what may be wrong or which IP I am supposed to use to connect?

#

The Client transport is set to port 7777 and the server to 27777.
This is my web.config file:

high patrol
#

you're braver than I to run that inside IIS

orchid bridge
#

Hi I'm trying to upload my Ready Player Me with Netcode support (to use it as multiplayer game) in Unity. I recently publish it and once I paste the avatar url, I'm unable to click on the button it just doesn't load anything. This is the link of game: https://play.unity.com/mg/other/publicar-16 It works fine in my own computer but not when I share the link with other people it doesn't work for them. If someone can help me solving this it would be very appreciated.

Unity Play

My latest microgame.

obsidian cliff
#

New getting started guide for WebXR and Unity (+XR Interaction Toolkit). All you need to make it work in a game jam.
https://youtu.be/4wQG8_pb3cs

Getting started guide for WebXR Export and XR Interaction Toolkit in Unity, January 2024 Edition.

Base project uses:
Unity OpenXR package, Unity XR Hands package, XR Interaction Toolkit package and URP.
The base scene is from XR Interaction Toolkit Starter Assets sample.

Links from the video:
WebXR Export - https://github.com/De-Panther/unity-...

▶ Play video
serene orbit
charred briar
#

Ah, weird. ACE prefix for internationalized domain names. You learn something new every day

serene orbit
#

@charred briar I just wrote that to get rid of the personal info

#

That's not the actual url

#

the url is the itch profile

#

@charred briar this is the error

charred briar
serene orbit
#

I'm not familiar with web as I'm usually a mobile / desktop dev. Do you have any advice on how I can move forward with this?

charred briar
#

Hmm looks like it's a Google Cloud bucket

</Error>```
#

I've never seen our itch pages for our games generate that error before, but if it is an itch redirect of sorts, it looks like an itch bug to me

serene orbit
#

One thing that may be a clue is that it works on desktop safari but not on mobile.

charred briar
#

Yeah it'll work in some browsers, it's the browser blocking it, trying to stop you from getting a fishing site pretending to be itch.

serene orbit
#

Right that makes sense.

charred briar
#

Although in this case it looks like it is itch they just didn't configure something

#

It looks like where they dump your html files to once you upload a build

serene orbit
#

I was thinking it might be an itch issue so I was going to try to upload to to github pages but my LFS is broken lmao

#

batch response lfs denied

#

Got any other sites like itch I can try by any chance?

charred briar
serene orbit
#

I might just ask my client if I can get access to his web server to upload the build instead of using itch. I'm only using itch to test.

#

Could single out the issue if its only an itch thing

#

The app is using firebase and I had to manually add some code to the index.html, im not sure if that can cause hte issue.

#

But it's just firebase generated auth stuff

#

This all works in browser on desktop, so i dont see how it could

charred briar
#

If you have your own anything though, even dedicated WordPress, you can just ftp it up to test.

#

Unity also has its own web hosting I think now for web builds

late ocean
#

What

#

😐

serene orbit
#

To your knowledge though are these things I can change or modify in the editor at all?

main shale
# charred briar I'm 95% sure it's itch.io

itch needs to zip and can cointain max 1000 files, keep loading by demand and not atlas scpite maps, simmer got to mutch ads trackings speed gone to low - one ads in side would be accepted but not during all loads, addressables gzip, has it any server side scripts for leaderboard or save gamestand and connect users.

main shale
#

dark mode / light mode feature, i see there, and 13 pages of games can be sorted by category on search. full screen, but embeded can be problematic if some devs dont like to see game moved. search by dev also there, players can not rate without some logins, if game fineshed it schould be able by any player to be rated. stars 50/100, compare more and show us info.

main shale
obsidian cliff
main shale
obsidian cliff
main shale
#

build for xr

#

your title: New getting started guide for WebXR and Unity (+XR Interaction Toolkit). All you need to make it work in a game jam.

#

but with ps4 controller ( trust me keyboard and mouse would work see mozilla webxr js )

obsidian cliff
main shale
#

navigation

obsidian cliff
#

And how ps4 controller is related?

#

I'm confused

main shale
#

lets see here, there are a lot of input options, but why not use the standard of gamepads, https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API/Inputs

MDN Web Docs

A full WebXR experience isn't just about showing the user a wholly virtual scene or augmenting reality by adding to or altering the world around them. In order to make an experience that's fulfilling and engaging, the user needs to be able to interact with it. To that end, WebXR provides support for a variety of kinds of input devices.

obsidian cliff
#

I'm still not getting what you are trying to say.

main shale
#

just simple using a bluetoth gamepad controller and at same way VR as double screen big monitors

obsidian cliff
#

I have no idea what you are talking about.
The video was about using Unity with WebXR.
On what part of the video are you commenting?

main shale
#

Add WebXR Input Profiles ( controller types was q )

obsidian cliff
main shale
#

package manager /if sup input system but thats diffrent, continue your way.

main shale
#

if supported input system to work with webxr or any kind of VR (in relation gamepad)

obsidian cliff
#

The Immersive Group of W3C created a database of 3D models and description profiles of XR controllers.

As part of the WebXR API, there's a list of profile names to the connected XR input source.

So when in XR session in WebXR, developers can read this value, check the XR controllers database, and load the relevant model.

#

This is the repo for the database
https://github.com/immersive-web/webxr-input-profiles
This is the repo for the Unity loader
https://github.com/De-Panther/webxr-input-profiles-loader

GitHub

WebXR Gamepad assets, source library, and schema. Contribute to immersive-web/webxr-input-profiles development by creating an account on GitHub.

GitHub

WebXR Input Profiles Loader in Unity. Based on https://github.com/immersive-web/webxr-input-profiles - GitHub - De-Panther/webxr-input-profiles-loader: WebXR Input Profiles Loader in Unity. Based o...

#

I don't get how mouse/keyboard or PS2/PS3 controller is related here?

main shale
# obsidian cliff I don't get how mouse/keyboard or PS2/PS3 controller is related here?

Using keyboard and mouse events , in doc they show keyboard WASD
document.addEventListener("keydown", (event) => {
switch (event.key) {
case "a": case "A": avatar.posDelta.x -= ACCEL_X; break;
case "d": case "D": avatar.posDelta.x += ACCEL_X; break;
case "w": case "W": avatar.posDelta.y += ACCEL_Y; break;
case "s": case "S": avatar.posDelta.y -= ACCEL_Y; break;
default: break; }}); // https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint

MDN Web Docs

A DOMPoint object represents a 2D or 3D point in a coordinate system; it includes values for the coordinates in up to three dimensions, as well as an optional perspective value. DOMPoint is based on DOMPointReadOnly but allows its properties' values to be changed.

obsidian cliff
main shale
# obsidian cliff What is this code? How is it related to this? And it's not in the link you provi...

https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API/Inputs //but only the part of keyboard is listed not mouse at Using keyboard and mouse events

MDN Web Docs

A full WebXR experience isn't just about showing the user a wholly virtual scene or augmenting reality by adding to or altering the world around them. In order to make an experience that's fulfilling and engaging, the user needs to be able to interact with it. To that end, WebXR provides support for a variety of kinds of input devices.

obsidian cliff
main shale
obsidian cliff
main shale
obsidian cliff
main shale
#

yes i am asking (good&fast work of) phyical input controller, like keyboard, mouse, gamepad

obsidian cliff
#

Ok, I think that now I got what you tried to ask.

It should work. Depends on the device and browser.

main shale
#

physical bluetooth input controller: first of all keyboard, mouse than gamepad controller ps3 (any brands)

obsidian cliff
#

Developers made "virtual desktop" like experiences using WebXR on Quest.

But they didn't use Unity.

The way Unity on web works, should support it.
But I didn't test it.

main shale
obsidian cliff
#

Detecting different gamepad types depends on the Operating System and the browser.
If it's detected in the browser not in XR mode, it should be detected in XR mode as well.

But I didn't try it.

main shale
#

let me explain the
left game stick position |__ and the / trigger on side for one hand to config, press on stick

charred briar
main shale
#

we know some moderators, if they want to nerve, than they ask are you ai talking english, but dont get disturbt focus

#

how they think there is so mutch of millions of $ i dont really know, even not hope ai to be a money maker machine

obsidian cliff
main shale
#

what i read is web xr has its own input, but like in that code other inputs can replace and forward, reconfigured.

obsidian cliff
obsidian cliff
charred briar
obsidian cliff
charred briar
#

It's not pertinent to the convo

main shale
obsidian cliff
main shale
#

we are in topic of input controller, please, let us know is a physical bluetoth game controller supported , for VR webxr

charred briar
#

I'm going to heart instead of thumbsup, because I appreciate you trying and being patient with them, and a thumbs up seems dismissive without being supportive

obsidian cliff
#

You'll have to try and see if the devices you want to use works.

main shale
#

it has not to be answered now, it can be add in this channel if you get some news about it, thx.

obsidian cliff
#

It's not something that I'm going to try.
But if you'll try, you are welcome to update us what devices you used and if it worked.

brave tide
#

hello, all creative and beautiful minds across the globe. Today is my 1st day, here.

#

i have been trying to make a playble ads, and i thought that i will do it with the help of WebGL build. but it is giving a lot of file and i need a single html file. now after spending a lot of time, i am thinking is it even possible to make a playble ad directly from unity/ webgl.

charred briar
#

Personally I wouldn't use Unity for it

brave tide
#

i have also got this time with luna. is it good? and i want to know your method.

sweet oriole
sweet oriole
clear grotto
#

i was wondering if some of you can share how much memory your webgl game uses in the browser and if you had to tweak the build to lower it (mine is currently at 141mb and it feels like a lot)

vocal vapor
#

Not sure which channel best fits this question, but it's a WebGL issue so guessed here?

https://issuetracker.unity3d.com/issues/indexoutofrangeexception-in-uielements-dot-layout-dot-layoutmanager-dot-destroynode-when-changing-uxmls

Is there any alpha download or something I can download with this fix? Or, does anyone have any idea how long it might take before I can try using it?
[I don't fully understand the ticket status]

This issue is severely slowing me down, trying to build ridiculously hacky work-arounds that barely work; so, I am very eager to finally have it.

charred briar
#

Anything small and lightweight. You'd need to check each one to find one with official support however

astral wave
clear grotto
astral wave
# clear grotto i see.. my game is a 2d slot machine type game and is 1 scene atm. my assets are...

Most likely you have textures that takes most of your memory. Or maybe you using URP and leave too many possible quality settings (low, medium, high) or features you don't need. I strongly suggest to use https://docs.unity3d.com/Packages/com.unity.memoryprofiler@1.0/manual/index.html
which will give you detailed informationabout your memory usage. Have in mind that profiling should be done on build version and not editor, as differences are very big. Also textures and images compression format is very important, as in game you DO NOT sure png. Png will be transformed to format that rendering understand. And mobile and pc uses different formats, at here you can find your png that is 1024x1024 and size of 17 Kb will actually be converted into RGB 32 and will eat 4mb of memory (while compressed with correct compression uses 1mb). More about it here (https://docs.unity3d.com/Manual/class-TextureImporterOverride.html). In most cases textures size and format is main culprits for bug memory usage

clear grotto
#

i had downloaded the memory profiler yesterday but was running it in editor mode and dismissed it when i saw 2gb memory 😅 . didn't know u can do it in build version that will definitely help

astral wave
solar hound
#

Hi Friends, I have set custom mouse pointer design in unity webgl and in my page i use a image picker so whenever I open it and then when its close the mouse pointer come back into its normal design, so basically i want to keep my custom mouse pointer when i come bake to unity webgl

astral wave
solar hound
#

this issue only occur on chrome

astral wave
cinder creek
#

Hey guys, how is the build process? Has it been improved or it still takes forever to build a 20 mb project?

#

Paused on Unity for a while and deciding to come back to work on project...

random talon
#

Can somebody help me figuring out how to call a method from the index.html to unity script?

I've made a method inside the index.html that detects the device when the WebGL app is loading,
after that I need to communicate it to Unity by calling a method called _SetPlatform(int) how can I reach it?

arctic rose
#

Have Unity call that function instead

random talon
arctic rose
#

I mean have Unity call that function instead

random talon
#

does it detect all devices without issues?

arctic rose
#

I don't see how that's related to the question

random talon
#

Im not understanding your solution

arctic rose
#

Make a jslib function that calls InvokePlatformSpecificMethod, call that function from Unity when the game has loaded

#

If you need this function to run before the Unity game has loaded, store the result to a variable and retrieve it with a jslib function when you need it

random talon
#

Ok now it makes sense, im ok with calling it once unity finished loading, the only thing I miss is how to get a var in return after having called that method

arctic rose
#

return 3 instead of setPlatform(3) and so on. Define the extern method as returning int

random talon
#

So assuming I call this method inside a .jslib at start, is it supposed to work or do I miss something?

arctic rose
#

Well depends how you call it

random talon
#

Like this?

#

I know that int isnt going anywhere, made it just to show it

arctic rose
#

yup, that should do it

#

as long as platform is defined somewhere, I'm not sure how strict the jslib file is

random talon
#

oh it works! thanks for the suggestion!

charred briar
cinder creek