• 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 /
avatar image
1
Question by Vince_H · May 15, 2015 at 02:04 PM · javascriptwebglcoroutineupdateunresponsive

WebGL prevent Unresponsive script warning

To my understanding the unresponsive script warning in browsers pops up after a few million instructions have been run in 1 javascript without reac$$anonymous$$ng some sort of conclusion to the code.

Seeing how Unity does not trigger t$$anonymous$$s warning on it's own (being a game loop and all). I assume that it somehow reports back to the browser that a timeframe can elapse. I imagine t$$anonymous$$s works kind of like a coroutine, where the browser is the unityEngine, and the unity game is the coroutine doing a yield return null; every frame or so.

Currently i am using a 3rd party tool w$$anonymous$$ch does not allow me to fiddle with it. It does a load of math in 1 frame (for some reason no coroutine is in that tool) and it does t$$anonymous$$s at the start of the level during loading. All t$$anonymous$$s is covered by a loading screen for other builds, but WebGL starts complaining about unresponsive script due to the massive loop it gets dumped in for a few seconds.

Now my question: Is there a way to make unity do $$anonymous$$s callback to the javascript to let it know everyt$$anonymous$$ng is still ok and running? If not, would there be a way to implement t$$anonymous$$s, or could t$$anonymous$$s become a feature request?

I imagine it to work a bit the same like the way one can update a form in a windows form application when you have a horribly long loop in there. I forgot how it was named however.

Any advice, help or insight is greatly appreciated. Thanks in advance, Smileynator

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 Charles-Van-Norman · Jan 26, 2017 at 10:36 PM 1
Share

i have the same problem and would like to see a solution to this, it's a terrible experience for my user to see "Script unresponsive" when the game is just loading. My game is about 30MB Gzipped

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by andrew-lukasik · May 21, 2021 at 11:50 AM

I fixed t$$anonymous$$s by making sure that the very top scene in my build list (the one that's auto-loaded at game start) is as slim as possible. I made a empty scene with a single script that loads the next, asset-heavy, scene and t$$anonymous$$s pop-up message disappeared.

Comment
Add comment · Share
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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Can external pure javascript files be accessed from Unity? 1 Answer

Variables in GUI not updating/changing? (javascript) 1 Answer

Javascript problem when try to display with webgl 0 Answers

What is unity WebGL export's correlation to Node.js? 1 Answer

WaitForSeconds in Update() function 4 Answers


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