[Unity3D Daily BUG] Unity3D packaged WEBGL platform running problems such as unable to parse gzip, build compression, etc.

recommended reading

Hello everyone, I am a Buddhist engineer ☆Tranquil Little Demon Dragon☆ . I update Unity development skills from time to time. If you think it is useful, remember to click three times.

I. Introduction

When packaging WEBGL in Unity3D, such an error occurs:
insert image description here

insert image description here
Specific analysis:

1. The xxx.gz file cannot be parsed.
2. The build compression is enabled, but the web server is configured incorrectly.
3. The web server does not support HTTP response header parsing

Two, the solution

(1) Suspect server configuration problem:

This error feels like a server error, and then it is found that there is no error on the server, and there is no problem with putting the previous package file, and the server error is ruled out.

(2) Determine whether it is a packaging error:

Find the project that can run normally before, and check the packaging settings:
insert image description here
the following picture shows the packaging settings that cannot run normally:
insert image description here
after checking Decompression Fallback, there is no error in packaging and running.

(3) Decompression fallback analysis

The official API address of Decompression Fallback: Unity - Manual: WebGL Player settings

insert image description here

Include decompression fallback code for build files in the loader.

Use this option if the server response headers cannot be configured according to the chosen compression method.

3. Postscript

If you find this article useful, don’t forget to follow it, follow it so you don’t get lost, and continue to share more Unity dry goods articles.


Your likes are your support for bloggers, please leave a message if you have any questions:

The blogger's homepage has contact information.

The blogger also has many treasured articles waiting for your discovery:

column direction Introduction
Unity3D development small game Small Game Development Tutorial Share some small games developed using the Unity3D engine, and share some tutorials for making small games.
Unity3D from entry to advanced getting Started Get inspiration from self-study Unity, summarize the route of learning Unity from scratch, and have knowledge of C# and Unity.
UGUI for Unity3D UGUI A full analysis of Unity's UI system UGUI, starting from the basic controls of UGUI, and then comprehensively teaching the principles of UGUI and the use of UGUI.
Reading data of Unity3D file read Use Unity3D to read txt files, json files, xml files, csv files, and Excel files.
Data collection of Unity3D data set Array collection: Knowledge sharing of data collections such as arrays, lists, dictionaries, stacks, and linked lists.
VR/AR (Virtual Simulation) Development of Unity3D virtual reality Summarize the common virtual simulation needs of bloggers and give case explanations.
Plugin for Unity3D plug-in Mainly share some plug-in usage methods used in Unity development, plug-in introduction, etc.
Daily development of Unity3D daily record It is mainly used by bloggers in daily development, methods and skills used, development ideas, code sharing, etc.
Daily BUG of Unity3D daily record Record the bugs and pitfalls encountered during the development of the project using the Unity3D editor, so that later generations can have some reference.

Guess you like

Origin blog.csdn.net/q764424567/article/details/130243103