Pause and unpause speds up game?

Hello all,

I am at a complete loss and have been experimenting all week end to try and work out why my games runs about 10 fps faster after I pause and then un-pause it.

I spent a while optimizing all the graphics and then added fog. After adding fog the frame rate dropped, until I pause the game. While paused I have a GUI pause menu on screen and I set Time.timeScale to 0 to stop all animations. In my player characters update I check for a pause flag and skip over a lot of the code if the game is paused. I have a camera follow script which still updates and is mainly 2 Mathf.SmoothDamp commands. I also set my sound effects to pause, but keep the main music playing.

I am now at a loss as to what to check for? I’ve tried removing the camera code, removing the sound and the fog. If I remove the fog the game plays at a solid frame rate from the start.

I am still using iPhone 1.7 (wanted to wait for 3 until it was out in case of changes and bugs).

I’m sure this is a impossible question to answer with the little info I can give, but anyone have any ideas on why fog could cause this, until I pause?

Cheers,

Richard

Can you post the character script, or at least the part that gets skipped when the pause flag is true?

Hello Andeeee,

Sorry, I didn’t get an email saying you had replied to this post, hence the slow responce. However, since posting I updating to unity 3 and the issue is resolved. I still have no idea what the pause menu was doing to speed up the game and I tried a few things like starting the game in pause mode for a few frames, but that didn’t work.

Thanks for the reply, but it all seems to be working now :slight_smile:

Richard