Quantcast
Channel: Questions in topic: "webgl"
Viewing all 2390 articles
Browse latest View live

Playerprefs issue in WebGL

$
0
0
Hi, I'm using playerprefs in my WordSearch Game that I built with Webgl. The Issue is appear when I close my game during the game play for several times. It's automatically starts with random countdown value such as 20, 140 etc with previous score(Sometimes Not the exact score that should be saved). Here's the code that I'm using playerpreds... [SerializeField] public float currentLevelScore = 0.0f; [SerializeField] private float timeLeft; [SerializeField] private string accessToken = ""; void Awake() { GetPlayerPrefData(); } void Start() { if(timeLeft == fixedTime) { PauseGame(); } //Retrive Saved Player prefs Data if (PlayerPrefs.GetFloat("timeLeft")<150 && PlayerPrefs.GetFloat("timeLeft") > 0) { StartGameCanvas.SetActive(false); } else { if(PlayerPrefs.GetFloat("timeLeft") == 150) { StartGameCanvas.SetActive(true); } } if (PlayerPrefs.GetFloat("timeLeft").Equals(0) || PlayerPrefs.GetFloat("timeLeft").Equals(null)) { PlayerPrefs.SetFloat("timeLeft", fixedTime); } } void GetPlayerPrefData() { accessToken = PlayerPrefs.GetString("accessToken"); currentLevelScore = PlayerPrefs.GetFloat("currentLevelScore"); float countdownTime = PlayerPrefs.GetFloat("timeLeft"); if (countdownTime <= 0) { timeLeft = fixedTime; } else { timeLeft = countdownTime; } } //This function is calls when the Time is up or user hit the quit button public void ResetAllData() { float defaultScore = 0; string defaultAccessToken = null; PlayerPrefs.SetFloat("currentLevelScore", defaultScore); PlayerPrefs.SetFloat("timeLeft", fixedTime); PlayerPrefs.SetString("timeLeft", defaultAccessToken); PlayerPrefs.Save(); } This issue is only occur after build the game. It's works fine in the editor. Can anyone give me an idea or help to solve this problem? any suggestions would be highly appreciated...

WebGL objects moves when screen resolutin changes

$
0
0
Hi, I have a game that include a game object fixed in the scene by this code. backgroundObject.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width / 2 + 150, (Screen.height / 2) + 35, 196)); I'm also using simmer.io webgl responsive template as well. Unfortunately, when my scene reloads, the gameobject slides to another position where it was. How to fix this issue?

Unity Connect wrong window size for game

$
0
0
When uploading a build of a webgl game to Unity Connect, the size of the player is wrong. The same build works in the right resolution if opened via a browser locally, but when uploaded as a game on unity connect, the resolution of the player window is not respected, and the content is skewed. Build resolution is 960*640, and as stated, works in browser. In unity connect, the window it's showed in is at my estimation 960*600. Any advice on how to redeem this issue, thank you very much.

Unknown WebGL Error

$
0
0
Hello guys. Would be happy if someone could help me figure out the origin of my problem. I have a WebGL app, and I receive this error while testing it in browser. I can't get what behaviour is causing the problem Invoking error handler due to Uncaught abort(180) at Error at jsStackTrace (Build.wasm.framework.unityweb:8:22325) at stackTrace [Object.stackTrace] (Build.wasm.framework.unityweb:8:22496) at Object.onAbort (https://gba-usa.project-release.info/wp-content/themes/gba-usa/garage/Build/UnityLoader.js:4:11047) at abort (Build.wasm.framework.unityweb:8:485461) at wasm-function[49907]:0xcece3e at wasm-function[21875]:0x77be68 at wasm-function[49030]:0xcc0849 at wasm-function[20986]:0x743c0c at wasm-function[25972]:0x83edfe at wasm-function[20983]:0x7438f8 at wasm-function[49713]:0xcec52d at dynCall_viiii [Object.dynCall_viiii] (Build.wasm.framework.unityweb:8:477504) at invoke_viiii (Build.wasm.framework.unityweb:8:372777) at wasm-function[23524]:0x7d2078 at wasm-function[44040]:0xbe3cf1 at wasm-function[26108]:0x843e58 at wasm-function[26104]:0x843c80 at wasm-function[26127]:0x8451e1 at wasm-function[26126]:0x844c47 at wasm-function[26118]:0x8444fa at wasm-function[26115]:0x844239 at wasm-function[20708]:0x73b8e2 at wasm-function[25936]:0x83e508 at wasm-function[19121]:0x7197e2 at wasm-function[49687]:0xcec1ff at dynCall_iiiii [Object.dynCall_iiiii] (Build.wasm.framework.unityweb:8:463723) at invoke_iiiii (Build.wasm.framework.unityweb:8:347221) at wasm-function[47301]:0xc75306 at wasm-function[46614]:0xc55199 at wasm-function[4099]:0x18cb29 at wasm-function[4098]:0x18ca57 at wasm-function[10036]:0x3c2501 at wasm-function[10020]:0x3c11ed at wasm-function[11994]:0x4bd0b9 at wasm-function[11993]:0x4bcdd3 at wasm-function[10424]:0x3edac6 at wasm-function[10144]:0x3cb9ac at wasm-function[10144]:0x3cb9c1 at wasm-function[10136]:0x3caba4 at wasm-function[10130]:0x3c9210 at wasm-function[49701]:0xcec431 at dynCall_v [Object.dynCall_v] (Build.wasm.framework.unityweb:8:471861) at browserIterationFunc (Build.wasm.framework.unityweb:8:184350) at runIter [Object.runIter] (Build.wasm.framework.unityweb:8:187411) at Browser_mainLoop_runner (Build.wasm.framework.unityweb:8:185873)

when playing game blank screen is showing in webGL

$
0
0
I have build game with webGL and when I am playing the game blank screen is comming in place of scene. This is happening only on chrome but on firefox it is working. Also in other people system it is working fine only in my systems chrome it is comming as black page. Here is the screenshot of issue (https://www.screencast.com/t/VhywZor1). Please tell me how can I resolve this issue if I have proper graphics card in my system and I have also updated the chrome version.

360 Video Player not working on WebGL build

$
0
0
Hello! I am trying to create a panoramic video player that would work on browsers. I have followed the Panoramic Video tutorial from the documentation (https://docs.unity3d.com/Manual/VideoPanoramic.html) and managed to get a video player that can correctly play a 360 video on the PC build. However, when I switch the platform to WebGL and use Build and Run to pass by the security restriction of Chrome (as discussed here https://forum.unity.com/threads/unity-webgl-not-supported-on-google-chrome.306512/) my video simply does not play. I do not receive any errors, the scene builds and then I only get a black screen. I have searched the web but did not find anything useful. Thank you for your time!![alt text][1] [1]: /storage/temp/151136-build-output.png

How to delete tutorial game published to web

$
0
0
Downloaded the editor today and ran through the racing game tutorial. It ends with prompting you to export a WebGL build of the game, which I did, for completionist's sake. Now I want to delete this project, including the playable version on the web, and I don't see it listed anywhere under my projects when I sign into my account.

ARCore WebGL error

$
0
0
I'm trying to build my ARCore App for WebGL but I get this error every time: uncaught exception: abort("To use dlopen, you need to use Emscripten's linking support, see https://github.com/kripken/emscripten/wiki/Linking Is there any way to solve this?

WebGL Game Window not Aligned with Canvas

$
0
0
I'm not too sure how to explain this other than showing an image. The WebGL canvas/window is not lining up with my game window. There are white bars on the top and the left of the canvas. This happens on all websites. ![alt text][1] [1]: /storage/temp/151354-help.png

Retrieving Data from websocket for Unity WebGL game leads to an exception : “Uncaught RuntimeError: memory access out of bounds at wasm-function”

$
0
0
I've been trying to retrieve data from websocket to my unity webgl game. It's working fine and validating successfully to authorize the user. But As soon as calling the function to retrieve the data and populate the lists, arrays and Dictionaries that I defined, Its throwing and error like below in the build and deploy in the instance. This is how I do the stuff. IEnumerator RetrieveWordsAndDefs(string accessTokenGetData) { string getDataFromURLLocal = "https://api.samplecloud.com/gamequestion?site=" + site + "&game=" + gameId + "&access_token=" + accessToken + "&token_type=Bearer"; using (UnityWebRequest uwr = UnityWebRequest.Get(getDataFromURLLocal)) { uwr.SetRequestHeader("Content-Type", CONTENT_TYPE); uwr.SetRequestHeader("x-api-key", X_API_KEY); bool onetimeGet; yield return uwr.SendWebRequest(); if (uwr.isNetworkError) { Debug.Log("Error While Sending: " + uwr.error + " respose Code : " + uwr.responseCode + " isNetworkError : " + uwr.isNetworkError); //messageText5.text = "Error While Sending: " + uwr.error + " respose Code : " + uwr.responseCode + " isNetworkError : " + uwr.isNetworkError; } else { Debug.Log("Received: Data" + uwr.downloadHandler.text + " respose Code : " + uwr.responseCode + " isNetworkError : " + uwr.isNetworkError); string jsonWordAndDefs = uwr.downloadHandler.text; DeserializeJsonData(jsonWordAndDefs); } } } private void DeserializeJsonData(string jsonWordAndDefs) { words = null; def = null; singleText = null; if (!String.IsNullOrEmpty(jsonWordAndDefs)) { RootObjectData rootObjectData = JsonUtility.FromJson(jsonWordAndDefs); int count = rootObjectData.tasks[0].words.Count; def = rootObjectData.tasks[0].words.Zip(rootObjectData.tasks[0].definitions, (k, v) => new { k, v }).ToDictionary(x => x.k, x => x.v); words = rootObjectData.tasks[0].words.ToArray(); singleText = rootObjectData.tasks[0].definitions.ToArray(); words = words.Where(x => !string.IsNullOrEmpty(x)).ToArray(); words = words.Where(x => !string.IsNullOrWhiteSpace(x)).ToArray(); foreach (KeyValuePair kvp in def) { //messageText1.text += string.Format("{0} : {1} \n", kvp.Key, kvp.Value); } } } But when I deploy it in my websocket and and Run, I'm getting this errors to be appear in console of web browser exception thrown: RuntimeError: index out of bounds,@blob:https://sample Uncaught RuntimeError: memory access out of bounds at wasm-function[19588]:0x81e4f1 at wasm-function[42109]:0xcaa7fc at Object.dynCall_iii... does anyone know how to solve this issue? any suggestion would be really helpful. Thanks

WebGL Build bugged Colliders

$
0
0
Hello, I am working on a prototype 3D game, and it's working just fine in Editor/PC Build, but, due to specifics of the projects, I would prefer having it running in browser so I would need it built for WebGL. After building my project for WebGL, it appears some colliders (or centers of some objects) are somehow being misplaced. You can see what I mean in the image down under.
My question is: Has anyone encountered anything similar or knows what might be causing this behavior? Colliders are not being misplaced to some fixed position, it appears to be random.
Picture on the left shows position of the collider in editor/pc build (where it SHOULD be), and the one on the right shows an example of where the collider actually is after WebGL build. ![alt text][1]
Any suggestion/help would be highly appreciated. [1]: /storage/temp/151444-screenshot-1.jpg

Loaclization in WebGL?

$
0
0
Hi, - I would like to implement multiple languages into my WebGL build. I already did this tutorial: https://youtu.be/5Kt9jbnqzKA to get used to the general idea. But sadly the "StreamingAssets" folder can't be accessed directly when building for WebGL. Has anyone experience with this and could point me in the right direction on how to accomplish localization in WebGL? - Thanks in advance :)

Sub-meshes fallen apart in VR

$
0
0
I have an object with multiple sub-meshes. On each of the sub-meshes, I am using: 1. Mesh renderer 2. RigidBody 3. Box Collider 4. (Mesh filter) In Editor, everything appears as normal. However, when I view the object in VR (WebGL), all sub-meshes are not intact. Instead, it looks they have all fallen apart at different locations, much like a dismantled object. Any idea why?

Webgl and System.IO.Director emscripten's linking support

$
0
0
Hello. Recently I've upgraded my webgl project from 2018 to 2018 LTS. **Short about the project:** - user can create some textures and other assets in webgl build - while he is working all data (images, text, json etc.) is saved on local storage that creates when user lauch the page with webgl build for first time (persistentDataPath/UserID/Projects/Type/ProjectName) - after the work is done all local data is compressed to a .zip archive and is sent to server **About the error** After launching the build I get an error in browser console when trying to create a new work folder To use dlopen you need to use emscripten's linking support unity The library that is throwing this error is System.Io Actually, it's System.Io.Directory.CreateDirectory(); It worked perfect until I upgraded to 2018 LTS Any suggestions?

WASM - Unity WebGL & NodeJS

$
0
0
Hey Guys I'm running a nodeJS game in unity. when ever i try to action the nodeJS by sending data I get this error and the freezes Uncaught abort(52) at Error at jsStackTrace (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:22313) at Object.stackTrace (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:22484) at Object.onAbort (http://brainiacchess.network/test/tempppp/Build/UnityLoader.js:4:11047) at abort (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:488269) at wasm-function[46770]:0xd8301d at wasm-function[20511]:0x889eab at wasm-function[43556]:0xce1d5f at wasm-function[20511]:0x889eab at wasm-function[43565]:0xce2a6a at wasm-function[23343]:0x8ec887 at wasm-function[20905]:0x89ea21 at wasm-function[46705]:0xd82bec at Object.dynCall_viiii (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:478696) at invoke_viiii (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:370301) at wasm-function[43562]:0xce2331 at wasm-function[43568]:0xce2d60 at wasm-function[45745]:0xd53789 at wasm-function[46703]:0xd82bbf at Object.dynCall_viii (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:477592) at invoke_viii (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:368308) at wasm-function[44188]:0xd09351 at wasm-function[44186]:0xd09290 at wasm-function[44185]:0xd09225 at wasm-function[44184]:0xd091e4 at wasm-function[26286]:0x975f9c at wasm-function[28798]:0xa09304 at wasm-function[44177]:0xd08d81 at wasm-function[24230]:0x90ce41 at wasm-function[32157]:0xaab8fa at wasm-function[32182]:0xaacb64 at wasm-function[25042]:0x933462 at wasm-function[25043]:0x933478 at wasm-function[22689]:0x8d27a9 at wasm-function[24828]:0x92ab4a at wasm-function[23343]:0x8ec887 at wasm-function[46705]:0xd82bec at Object.dynCall_viiii (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:478696) at invoke_viiii (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:370301) at wasm-function[44548]:0xd1a994 at wasm-function[24763]:0x9289f7 at wasm-function[24972]:0x92fced at wasm-function[24995]:0x9312c6 at wasm-function[24994]:0x930d2c at wasm-function[24986]:0x9305df at wasm-function[24983]:0x93031e at wasm-function[22526]:0x8cc129 at wasm-function[24797]:0x92a46b at wasm-function[20964]:0x8a7683 at wasm-function[46680]:0xd828d4 at Object.dynCall_iiiii (blob:http://brainiacchess.network/6db4ba9f-6758-45b7-a77a-f9c6bc9f2e05:8:463998) Any help on how to fix PLEASE!!! Thank you :D

WebGL won't build

$
0
0
So i am kind of at a loss here, i am trying to make a webGL build to test out some things however i just cannot find a solution for this issue. This is the error log i am getting> UnityEditor.BuildPlayerWindow+BuildMethodException:> 3 errors>> at> UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer> (UnityEditor.BuildPlayerOptions> options) [0x00242] in> C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:194>>> at> UnityEditor.BuildPlayerWindow.CallBuildMethods> (System.Boolean askForBuildLocation,> UnityEditor.BuildOptions> defaultBuildOptions) [0x0007f] in> C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:97> UnityEngine.GUIUtility:ProcessEvent(Int32,> IntPtr) some help would be greatly appreciated

Arabic characters are displayed normally in editor, playmode and windows build but not in WebGL build?

$
0
0
Hi, - I want to have multiple languages in my project including arabic and want to distribute it as an WebGL build. When adding the text in arabic it shows correctly in the editor, and in play mode as well as when building it for windows but as an WebGL build it just disappears and the text field is blank. Any ideas why and how to solve that? - Thanks in advance

How to reduce loading time of facebook instant game in "mobiles"?

$
0
0
HI. My facebook instant game is taking 15 sec to Load.But it has to load within 5 seconds.In desktop it is loading quickly. game.data.unityweb size is 1.5 mb And game.wasm.code.unityweb size is 4.8 mb. upto 90% it is loading quickly but it is taking time for the remainig 10% is there any way to reduce the loading time in mobile ? Thank you

WebGL Build - Video Player Shows Black Screen in all Browsers

$
0
0
**Two Part Question** I have a video imported to a folder in my Unity 2019.2 project. The video player shows the video playing in the Game window on preview, but on WebGL Build-and-Run, both browsers (Firefox and Chrome) show only a black box and do not play the video. Then I tried uploading the project to a web server, however there I run into another problem. On launch I get an error message that says: *An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was: SyntaxError: expected expression, got '<'* So I look at the error in the web developer console for the browser, which gives me no information at all that I know how to use. It just says: *Invoking error handler due to SyntaxError: expected expression, got '<'* and it shows me the line (4953) in UnityLoader.js that generates the error message. So why would the video work in the Game window, but not in the browser, and how can you test it on the web server if the published files are generating JavaScript errors? Any advise would be appreciated.

HTML canvas element disappears (NO DISPLAY) after Route change

$
0
0
Hi, friends Im integrating Unity3d In React JS App.... with direct link if we load page unity game screen showing and working fine. on route changes and back to unity route game screen not showing. html canvas element is disappearing.. but unity sendmessage working.. anybody know how to load gamescreen without re initializing unityinstance?? Thank you
Viewing all 2390 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>