Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Matthias1231 · May 15, 2012 at 02:13 AM · performancewebplayerpausing

Website responsiveness and Unity hogging the CPU

My web based Unity game is interacting with the website and encouraging the user to go back and forth between it and the webpage the game is embedded in.

When the game runs the webpage becomes generally sluggish, scrolling becomes jumpy, etc. That is fine as long as the user is engaged with the game but interacting with the page is a pain.

I figured I can just stop/pause the game when it loses focus (OnApplicationFocus), but no matter what I try at that time, the webpage stays unresponsive.

I tried setting Time.timeScale to 0, Time.fixedDeltaTime to 0.2 or higher, Application.targetFrameRate to 2, disabled all the Cloth objects, etc.

Nothing will stop Unity from hogging all the resources. Is there any way I can limit how much CPU Unity will use? I am fine with completely stopping the game, but I would like to keep the last rendered frame visible.

Thanks for any ideas!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Justin Warner · May 15, 2012 at 03:28 PM

Hey Matt,

http://forum.unity3d.com/threads/32016-Unity-webplayer-eating-mah-Memory

That looks similiar.

Solution: Application.targetFrameRate

Didn't know this existed, so thanks =).

Comment
Add comment · Show 1 · 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
avatar image Matthias1231 · May 15, 2012 at 05:36 PM 0
Share

Thanks for the link, but I have tried targetFrameRate with different settings with no meaningful success.

I get the best result so far by disabling all Renderers in the scene, but that leaves me with an empty background.

I might try to render to a Texture on pause and then disable all the Renderers and show the last frame in a GUI.Box while it's paused.

There has to be a way to add a sleep or something to make Unity take a break and give up CPU resources?!

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Flash vs Webplayer - Performance Investigation 1 Answer

MMO games in the Web Player: lots of players and game performance. 1 Answer

Severe performance problem with 2 instances of web player 3 Answers

Stuttering web player 1 Answer

Performance Differences in Standalone player versus Web Browser? 2 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