Help on my WebGL game

When I try to play my Text101 game on the Google Chrome browser, it doesn’t start loading.

I tried it on Microsoft Edge as well

Why does this happen? What can I do to solve this problem?

Also, I didn’t post my game on the “share my game” site because I would prefer to not share it (if that is important).

Unity 2D Game Development
Lesson 33


Have you already tested your game in another browser such as Chrome or Firefox?

Hi, I used it on Chrome and when that didn’t work, I tried Microsoft Edge. Neither worked.

I’m not sure if this helps, but if I click "Inspect’ on my game, there is an error that says “Access to XMLHttpRequest at ‘file:///C:/Users/[PRIVATE INFORMATION]/Downloads/A%20Knight’s%20Survival/Build/A%20Knight’’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.”

This error was on Chrome.

It’s not a big deal if you don’t know a solution, because I don’t have to play my game on a browser, it’s just that I don’t want this happening in the future when I do.

CORS is a security restriction in modern browsers which prevents loading data from from sources that are not explicitely permitted. Since your error message mentions CORS, I assume that there is no problem with your project.

I usually set privacy.file_unique_origin to false in the settings of Firefox to test my game locally, and set it back to true afterwards. See here. (You do not have to download anything.)

If you upload your game, for example, onto, you should not get any CORS error message.

This sort of worked. Now, my game does start loading but it stops near the end.

A weird thing I forgot to mention in that when I downloaded my game on Unity using the “Build and Run”, since Unity starts the game immediately after downloading, my game loaded (It has never fully loaded since then).

Check the console again if the game gets stuck during the loading process. Or refresh the browser.


Uncaught ReferenceError: unityFramework is not defined
onload file:///C:/Users/[FILENAME]/Downloads/A Knight’s Survival/Build/A Knight’s Survival.loader.js:1

Do you use an antivirus program or a firewall that might be blocking the build?

And which vcersion of Unity do you use?

Also ensure that your file and folder names only contain ASCI characters, no apostrophes. And the build must not be saved inside the project folder.

I do use an antivirus program.

I use Unity 202.3.6f1.

I don’t think there is anything wrong with my build location.

I read online to turn of compression in player settings, and that worked.

What does compression do?

“Compression” makes the files smaller but they must get unpacked. Not all servers can do that. Setting the “Compression Format” to “Disabled” is definitely worth a try.

I do use an antivirus program.

Which one? And have you checked if it’s blocking anything important?

I use adaware. I don’t think it’s blocking anything.

However, my main concern is with compression. If I were to not compress all of my games from now on, would that later cause an issue?

Not at all. The compression just makes the files smaller but won’t affect your game itself. Even if some website expected a compressed build: As long as you keep your Unity project, you can always create a new build that meets the requirements of the target platform.

Thank you.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.