Questions tagged [unity-webgl]
The unity-webgl tag has no summary.
47 questions
0
votes
1
answer
62
views
How to build a Unity WebXR scene that uses raycasters?
I am fairly new to Unity. I want to create a VR project that I build to WebXR and publish to the web. I am using the sample scene from this project and it helps me get up and running. I am able to ...
0
votes
0
answers
29
views
Is it impossible to do an XMLHttpRequest from Facebook Instant Games?
I'm trying to store/fetch data from my own backend in my Unity WebGL build. I want to host this build on Facebook Instant games.
Content-Security-Policy: The page’s settings blocked the loading of a ...
1
vote
1
answer
305
views
Is this code using Awaitable correct?
I am upgrading my code from coroutines to using async-await and Awaitables on Unity 6. I have the following code of a spawner:
...
1
vote
1
answer
251
views
How to copy text from my web game that I hosted on Itch.io?
I am having trouble copying specific text to the clipboard in a game I developed in Unity that I am hosting directly in the browser on Itch.io.
The code I implemented works perfectly in the editor and ...
1
vote
0
answers
216
views
Minimal Content-Security-Policy (CSP) for WebGL Builds
I have a Webgl build created in Unity 2020.3.22f1.
The Content Policy looks like this (set to report-only for debugging):
Code (htaccess):
...
1
vote
0
answers
338
views
Have black screen after build game on web gl
Good day.
Everything works fine for me on the unity stage, but as soon as I start the game, after the unity screensaver I get a black screen with an interface, what to do, please help.
My console
<...
0
votes
1
answer
119
views
Skybox doesn't get displayed on mobile Chrome in Unity WebGl
In my webgl build skybox is completely purple on mobile Chrome browser but works fine on PC and mobile firefox. Is there any fix for this?
Edit:
This is my skybox material and I didn't do anything ...
3
votes
1
answer
115
views
Compiling Unity to WebGL gives a Node ESM module error
I'm trying to build my multiplayer game to WebGL in Unity (using Mirror). However, when I press "build", it gives me the following three errors:
...
0
votes
3
answers
733
views
OVR Lip Sync in Unity WebGL project
I am using the Oculus VR (OVR) Lip Sync Plugin for an avatar in a Unity project which I want to deploy to a browser using WebGL.
The issue is that WebGL doesn't support Unity's ...
1
vote
1
answer
116
views
Character walks too fast when browser's hardware acceleration is turned off
I have posted a project on itch.io (here). My character walks with the speed I intended when Chrome's hardware acceleration is turned on but walks much faster when it is turned off. First, my friend ...
0
votes
1
answer
401
views
WebGL FPS is sometimes higher than max. FPS setting - why?
In lots of WebGL online games (all games I tested were made with Unity), my FPS is sometimes higher than the max, FPS setting of my PC (75), but why?
0
votes
0
answers
183
views
Unity WebGL Game's Canvas UI scale changes with windows scale
So this is the setting that is affecting my game. My game is a webgl build from unity running in chrome, hosted on itch.io.
At 100% windows scaling setting, the UI elements have expected size,...
1
vote
1
answer
634
views
When loading only one item from the asset bundle in Unity, does the whole asset bundle need to get downloaded?
I am deciding on how to package my asset bundles that will be loaded from the web server at some point in the game. Currently I am thinking of packing them by types: for example, I would have one ...
0
votes
0
answers
2k
views
WebGL build project not open
I am a beginner in unity. Every time I build a project in WebGL this message shows up when I try to run it, "Failed to download file Build/build projectb.data. Loading web pages via a file:// URL ...
0
votes
0
answers
656
views
AudioSource.isPlaying is not working in Unity WebGL Build
I am passing a clip to play on the audio source. Next, I wait for the audio to finish to invoke the next action.
But the waiting loop never ends. Once the audio clip ends, the time I read from ...
1
vote
1
answer
1k
views
Do not cast shadows when transparent in unity
I am developing a game for WebGL and I have a shader that makes parts of an object in specific ranges of coordinates transparent, like so:
This shader makes all parts of an object with an absolute Y-...
0
votes
1
answer
522
views
How do I fix this assembly not found (UnityLinker.deps.json) error while building to WebGL?
I'm building a project and this error appeared; it's the first time I'm building it to WebGL from unity. Any help is appreciated.
...
0
votes
0
answers
270
views
Shader from urp shader graph turns gray on webgl1 build
When I build my game while graphics API is set to webgl1 the shader is just a gray texture.
It works fine if graphics API is set to webgl2 but I need it to work on webgl1.
Can shader graph shader ...
1
vote
1
answer
5k
views
What color format, depth buffer should I use in a RenderTexture for WebGL screen output in Unity? Is NPOT ok? MipMaps?
Today I learned about a technique for forcing uniform resolution in a Unity WebGL build, as described here in the answer by DMGregory. Yay! I'm experimenting with implementing this technique on a ...
10
votes
3
answers
5k
views
Performance degrading when resolution increases for a 4k screen
I am new to Unity.
I have a problem where my game has good performance on my non-4k screen.
Bur when I play it on my 4k screen, the performance gets really bad.
It looks like the resolution is ...
2
votes
1
answer
1k
views
How can I stop the Unity Video Player on WebGL from starting each video with a frame of all black?
Description
I'm working on a system to seamlessly reconstruct and play numerous segments of a continuous video stream by playing one segment on the active Video Player while loading the next on the ...
0
votes
1
answer
4k
views
WebGL game won't go into fullscreen mode on iOS devices
I have built my game and hosted it on itch.io. it works well on PC browsers and on the mobile Android browser.
The problem appears when I try to launch it on an iOS phone: the game won't go into full ...
0
votes
0
answers
467
views
Exporting WebGL For Mobile Browsers
I was asked by a client to create a pretty simple 3D game that will be embedded on a website, a plain landing page that will contain the game and will be played on mobile devices.
The game itself has ...
0
votes
2
answers
243
views
Can I give prizes based on sharing a WebGL game link on Facebook?
I made a share to Facebook link for my WebGL Unity game and depending on when you share you get extra points. This is tied to a button which once pressed opens a new page to Facebook for sharing the ...
1
vote
0
answers
2k
views
Reading from Streaming Assets in WebGL
I'm trying to set up my Unity game for WebGL, but I quickly found out that you can't access your streaming assets as you would in a standalone build. For example, I have a code snippet below of how I ...
0
votes
0
answers
507
views
Rendering Mode transparent is not applying in webgl build
I am using this method to convert opaque rendering mode to transparent.
...
1
vote
1
answer
859
views
How do I share a downloadable WebGL build in Unity?
When I make a WebGL build for my project, I get a folder that lets me click a .html to play my game in a browser. Is there a way I can share a folder like this for playtesters?
I tried sending a .zip ...
1
vote
1
answer
227
views
Equal 3D icon size visualization in Unity
I have some Icons (Sprite rendered in 3d world) whose icons are equal size (scale 1). Now I am trying to implement a solution that icons visually show at same size. If you see the icon at distance ...
1
vote
2
answers
123
views
Improving FPS by disabling unity events
I am trying to improve the fps and in my scene there are 4322 scripts attached to 4322 objects. When I activate those objects the fps go down. Right now it's around 100fps when i active those objects ...
0
votes
0
answers
1k
views
Unity3d FullScreen Mode Vertical Aspect Ratio in WebGl
My game has vertical aspect ratio and looks like this:
When I press full screen button
...
0
votes
1
answer
724
views
Simulate shake, tilt and multi-touch in Unity WebGl app
I am developing a multi-platform game in Unity.
It works great on Android and also on WebGL (haven't yet checked iOS).
My problem is that in some of the levels I need to use mobile-specific actions ...
1
vote
1
answer
2k
views
Webgl build error in unity
I get an error while trying to build a game for webgl. I have created a new 3d project with only a cube in it and have not created any scripts. When I try to build and run the webgl option, these are ...
1
vote
0
answers
320
views
Why would running WebGL app in Edge improve performance in Firefox?
I have a WebGL app (built using Unity 2019) which I'm testing locally in Firefox and Edge. If the app is only running in a tab in Firefox, it runs at 25 - 50 fps and has noticeable stutter. If I run ...
0
votes
1
answer
494
views
Assets bundles have higher size than uncompressed sprites
I've created a script that generates assets bundles by compressing sprites using LZ4 compression. I need this in order to generate smaller files that I'll download from a server at runtime but after ...
1
vote
1
answer
2k
views
Create and serve AssetBundle at runtime
What I am developing is not a game, but is done in Unity3d, so I believe here is a good place to ask.
Context:
The unity application runs in the WebPlayer inside a web application
Case:
User uploads ...
5
votes
1
answer
10k
views
How can I use websockets in a Unity WebGL project?
There are plenty of good Websocket APIs for C#, but I run into trouble when targeting Unity WebGL due to this restriction described in the Unity documentation:
No direct socket access
Due to ...
1
vote
0
answers
1k
views
Input.GetAxisRaw not returning zero after releasing the key
In my WebGL Project here is the way for camera navigation (Movement/Rotation) on Update event:
...
5
votes
1
answer
7k
views
How to use AssetBundles with Unity WebGL
I have a Unity WebGL project that tries to load AssetBundles, but I get an error:
Unable to open archive file: http://localhost:50212/StreamingAssets/Bundles/language_english
The code that creates ...
1
vote
1
answer
6k
views
How to copy text from an InputField to the clipboard in WebGL?
I would like to know if there is a solution to copy/paste the text from/to an InputField in a WebGL Unity app.
For security reasons, Unity WebGL doesn't allow text copy and paste in/from browser.
0
votes
2
answers
7k
views
Unity WebGL player just shows black screen
I built my Unity project with WebGL. After load the resources, I can hear the music and player sounds(movements etc), but it just display black screen only. I found some similar situation in google, ...
0
votes
1
answer
2k
views
Keeping score server side to prevent cheating
For my Unity WebGL game, I'm looking into storing the score of users in a database to make a highscore table (it's not a multiplayer game). Because client side code can always be "hacked", the advice ...
1
vote
3
answers
2k
views
Unity Facebook WebGL build... Does this work or not?!?! Getting conflicting answers
So here is the facebook documentation..
It seems to be saying you can output a Facebook WebGL build from Unity and upload it.
It does not work for me, I get this message when I upload.
"Games must ...
1
vote
0
answers
2k
views
Unity Pink Texture On WebGL
I'm trying to follow a youtube tutorial for my new game(images puzzle) and by using it's implementation on github to upload it later on facebook.
When I run the game inside unity editor its work ...
0
votes
1
answer
231
views
How to use Facebook Web Hosting for my Unity Game for both WebGL and GameRoom
As can be seen from the
Facebook's official Docs
It says that
To have both a Gameroom and a Facebook Web Game, you should leave your Facebook Web Games URL (https) unchanged. For example, https://...
2
votes
1
answer
2k
views
Build Unity from C# script
I'd like to build and package all the ports of my Unity game through a scripting system. Linux and Windows work fine through the Unity command line options, but there is none for WebGL.
For WebGL, ...
0
votes
1
answer
629
views
Unity WebGL audio not looping when started with playdelayed()
I have an audioSource in which loop is set to true.
I am starting it playing by calling playdelayed()
In the editor its plays fine. In a webgl build it does not loop. It just plays once.
Also in ...
1
vote
1
answer
826
views
Font Changes in WebGL Build
I'm attempting to make a game for WebGL. However, everytime I export a build, the font always changes on everything, just like below.
Original
WebGL
My default font is Arial and I have made a ...