Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 /
avatar image
0
Question by ElChileVengador · Aug 14, 2015 at 10:20 PM · uiwebplayerslow

Unity web player slow response to first interaction

Hi everybody,

I'm loading a small prototype to the web browser which just consists of unity UI buttons and menus. It loads quickly and works well until you press the first button. Then it takes a long time to respond (~10 s) before opening the appropriate menu. However after it does this the first time, all other interactions respond normally. This happens in both safari and firefox and does not disappear when I recompile. Any thoughts on what this could be?

Comment
Add comment · Show 2
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 ElChileVengador · Aug 14, 2015 at 04:49 PM 0
Share

It freezes for a long time. On a mac I even get the spinning pinwheel cursor. When running the profiler in the editor I get a spike on button press (Canvas.SendWillRenderCanvases using most of the resources), but it quickly drops back to regular frame rate.

avatar image ElChileVengador · Aug 14, 2015 at 07:36 PM 0
Share

Ok I see what you meant. On clicked the button calls this method in the UI manager:

 public void LeftButtonPressed() {
         ChangeForgeState (forgeState.cardSelect);
         leftButton$$anonymous$$enu.GetComponent<Forge_$$anonymous$$enu_Appear> ().Open$$anonymous$$enu ();
     }

the 'ChangeForgeState' method just activates and deactivates some UI elements:

 void ChangeForgeState ( forgeState _newState) 
     {
         switch (_newState) {
         case forgeState.cardSelect:
             buttonLeft.SetActive(false);
             buttonRight.SetActive(false);
             buttonTop.SetActive(false);
 
             break;
         case forgeState.forge:
             buttonLeft.SetActive(true);
             buttonRight.SetActive(true);
             buttonTop.SetActive(true);
 
             break;
         }
     }

meanwhile the menu appear has a small animation for the menu to appear:

 public void Open$$anonymous$$enu () {
     gameObject.SetActive (true);
     StartCoroutine(transform.$$anonymous$$oveTo (targetLocation.localPosition, animationDuration, Ease.QuadInOut));
     StartCoroutine(transform.ScaleTo (Vector3.one * targetScale, animationDuration, Ease.QuadInOut));
 }

($$anonymous$$oveTo and ScaleTo are tweening methods from the Automotion plug-in)

The menu that appears contains one panel and 10 buttons, but none have any special code on being enabled.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ElChileVengador · Aug 18, 2015 at 06:42 AM

Issue has been fixed. Apparently the culprit was the font renderer with the method Font.CacheFontForText. The solution was found in this thread:

http://forum.unity3d.com/threads/massive-font-cachefontfortext-cpu-spike-using-default-gui.227022/

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.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Extremely Slow Game Launching and Build 1 Answer

Unity UI is very slow?!? 1 Answer

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

Unity UI slow?(WaitingForJob and Canvas.RenderOverlays related problem) 1 Answer

Sluggish Controls in FPS Scene. 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