Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by powerhobo · Aug 27, 2018 at 08:53 AM · webglbuildingbuild settings

Building to Web GL fails EVERY TIME. What am I doing wrong?

I'm trying to build a text adventure game that I wrote about 3 years ago to WebGL, and it simply will not build. If I build to WebAssembly it will run for about an hour before asm2wasm.exe crashes. If I build to asm.js then it will run for a long time, then simply disappear as though it is complete, but nothing at all is created in the build folder. Unity doesn't even give me the courtesy of spitting an error at me.

Naturally, I tried it on other machines (3 of them), but with the same results. I've also tried an older version of Unity. So far I've tried 2018.1.9, 2018.2.2, and 2018.2.5. The game runs flawlessly in the editor.

I thought maybe it was an issue with converting 12,000+ lines of C# to java (it's a long game), so I made a fresh "game" from scratch that simply contains 1 scene, 1 small PNG asset, and 1 script (below), but the results are the same.


 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 
 public class TextController : MonoBehaviour {
 
     private enum States {
                             Start, State1, State2, State3a, State3b, State3c, State3d, State4, State5, State6, State7
 
     }
     public Text text;
     private bool haveKey = false;
     private States state;
     private int keyTimer;
 
     // Use this for initialization
     void Start () {
         state = States.Start;
     }
     
     // Update is called once per frame
     void Update () {
         keyTimer -=1;
                             if (state == States.Start)      {stateStart(); }
                             if (state == States.State1)     {stateState1(); }
                             if (state == States.State2)     {stateState2(); }
                             if (state == States.State3a)    {stateState3a(); }
                             if (state == States.State3b)    {stateState3b(); }
                             if (state == States.State3c)    {stateState3c(); }
                             if (state == States.State3d)    {stateState3d(); }
                             if (state == States.State4)     {stateState4(); }
                             if (state == States.State5)     {stateState5(); }
                             if (state == States.State6)     {stateState6(); }
                             if (state == States.State7)     {stateState7(); }
         
     }
     #region States
     void stateStart(){
         text.text = "This is the starting state.\n\n\n\nPress Enter to begin.";
         if      (Input.GetKeyDown(KeyCode.KeypadEnter) && keyTimer <=0) {keyTimer = 20; state = States.State1; }
     }
     void stateState1(){
         text.text = "This is State 1.\n\n\n\nPress 1 to go to State 2.\nPress 2 to go to State 3.";
         if      (Input.GetKeyDown(KeyCode.Keypad1) && keyTimer <=0)     {keyTimer = 20; state = States.State2; }
         else if (Input.GetKeyDown(KeyCode.Keypad2) && keyTimer <=0)     {keyTimer = 20; state = States.State3a; }
     }
     void stateState2(){
         text.text = "This is State 2, which only connects to State 1.\n\n\n\nPress Enter to return to State 1.";
         if (Input.GetKeyDown(KeyCode.KeypadEnter) && keyTimer <=0){keyTimer = 20; state = States.State1; }
     }
     void stateState3a(){
         text.text = "This is State 3a. A key is required to move to State 4.\n\n\n\nPress 1 to go to State 4.\nPress 2 to collect the key.";
         if      (Input.GetKeyDown(KeyCode.Keypad1) && keyTimer <=0)     {keyTimer = 20; state = States.State3b; }
         else if (Input.GetKeyDown(KeyCode.Keypad2) && keyTimer <=0)     {keyTimer = 20; state = States.State3c; }
     }
     void stateState3b(){
         text.text = "This is State 3b, which exists to tell you that you cannot progress to State 4 without the key.\n\n\n\nPress Enter to return to State 3a.";
         if (Input.GetKeyDown(KeyCode.KeypadEnter) && keyTimer <=0){keyTimer = 20; state = States.State3a; }
     }
     void stateState3c(){
         text.text = "This is State 3c. You have collected the key.\n\n\n\nPress Enter to go to State 3d.";
         if (Input.GetKeyDown(KeyCode.KeypadEnter) && keyTimer <=0){keyTimer = 20; state = States.State3d; }
     }
     void stateState3d(){
         text.text = "This is State 3d. You have the key to State 4.\n\n\n\nPress Enter to go to State 4.";
         if (Input.GetKeyDown(KeyCode.KeypadEnter) && keyTimer <=0){keyTimer = 20; state = States.State4; }
     }
     void stateState4(){
         text.text = "This is the State 4.\n\n\n\nPress 1 to go to State 5.\nPress 2 to go to State 6.";
         if      (Input.GetKeyDown(KeyCode.Keypad1) && keyTimer <=0)     {keyTimer = 20; state = States.State5; }
         else if (Input.GetKeyDown(KeyCode.Keypad2) && keyTimer <=0)     {keyTimer = 20; state = States.State6; }
     }
     void stateState5(){
         text.text = "This is the State 5.\n\n\n\nPress 1 to go to State 6.\nPress 2 to return to State 4.";
         if      (Input.GetKeyDown(KeyCode.Keypad1) && keyTimer <=0)     {keyTimer = 20; state = States.State6; }
         else if (Input.GetKeyDown(KeyCode.Keypad2) && keyTimer <=0)     {keyTimer = 20; state = States.State4; }
     }
     void stateState6(){
         text.text = "This is State 6.\n\n\n\nPress Enter to go to State 7.";
         if (Input.GetKeyDown(KeyCode.KeypadEnter) && keyTimer <=0){keyTimer = 20; state = States.State7; }
     }
     void stateState7(){
         text.text = "This is the State 7. There are no more states\n\nGame Over.\n\n\n\nPress Enter to restart.";
         if (Input.GetKeyDown(KeyCode.KeypadEnter) && keyTimer <=0){keyTimer = 20; state = States.Start; }
     }
     #endregion
 }

What am I doing wrong?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image powerhobo · Aug 26, 2018 at 08:35 PM 0
Share

Just fully uninstalled Unity, reinstalled, and tried to build an even simpler code program. One that does nothing more than fade transparency on a small png.


 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 
 public class ScreenFade : $$anonymous$$onoBehaviour {
 
     public Image img;
 
     private IEnumerator ScreenFader(){
         for (float i = 1; i >= 0; i -= Time.deltaTime)
         {
             // set color with i as alpha
             img.color = new Color(1, 1, 1, i);
             yield return null;            
         }
         Debug.Log("Fade-in complete");
     }
 
     void Start () {
         img.color = new Color(1, 1, 1, 0);
         StartCoroutine(ScreenFader());
             
     }
 }



Ran for almost half an hour, then asm2wasm.exe crashed with the following:

Problem signature: Problem Event Name: APPCRASH Application Name: asm2wasm.exe Application Version: 0.0.0.0 Application Timestamp: 5a8aaf6a Fault $$anonymous$$odule Name: asm2wasm.exe Fault $$anonymous$$odule Version: 0.0.0.0 Fault $$anonymous$$odule Timestamp: 5a8aaf6a Exception Code: c0000005 Exception Offset: 0000000000054488 OS Version: 6.1.7601.2.1.0.768.3 Locale ID: 1033 Additional Information 1: 8dc2 Additional Information 2: 8dc2fd2a632b17b6743a9504be473b6a
Additional Information 3: 3ed5
Additional Information 4: 3ed525bcd92b42f2d055b442df8ff8c3

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

155 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What are Unity's default emscripten arguments during build? 0 Answers

errors building with webgl 0 Answers

Unity won't let me build for Windows 0 Answers

WebGL build has a negative effect on the scene (Lighting problem) 0 Answers

WebGl build from command line doesn't work. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges