We’ve been getting some feedback from users playing our game that their systems’ processors spike to 100% while running the game. It then stays up there even when the app is hidden. It’s causing powerbooks to run rather hot.
Is this a usual occurance with Unity-built projects (I never really noticed it on my machine, but I’m running a G5)? And is there anything I can do to make the app less processor hungry?
Second: in the case when you want fewer frames per second, someone came up with a method to sleep a few milliseconds during each frame, to force Unity not to go above some number of frames per second. Jonathan Czeck just told me that you should do this:
We have our game set to run in the background in order to prevent cheating (it’s a timer-based word game). However, I believe that there’s a way to access the runinbackground variable from the script so at least I can turn it to false while in menus or paused.
I’m going to try the script Jonathan provided and see if that affects anything.
Oh, and dynamically setting the runInBackground toggle worked nicely, too. During any time where the timer is inactive (menu screens, paused, or non-timed game modes) we have the app turn off runInBackground which makes our app use a measly 2-5% processor on our test MacBook Pro.