I always have issues when publishing to a Unity Web target – usually the issues stem from compressed builds. Here is the configuration I use.
Build Profiles / Platform Settings
- Set Code Optimization to Runtime Speed rather than Shorter Build Time
Player Settings
- Set Company Name
- Set Product Name
- Set Version
Player Settings / Resolution and Presentation
- Set Default Canvas Width and Height to same as game
- Set WebGL template to PWA
- Set Product Description
Player Settings / Other Settings
- Set Managed Stripping Level to Minimal (if you get errors with the default of Low)
Player Settings / Publishing Settings
- Set Compression Format to Gzip
Apache 2
Add a .htaccess
file with the content from the section Use the virtual host in .htaccess method.
Ensure the user and group of the folder is set to www-data:www-data
(chown) otherwise the Content-Type set in the .htaccess
is not run (despite the .htaccess
file is still parsed and shows up in the Apache error log).
Leave a Reply