Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: capitalj on January 23, 2013, 07:29:56 PM
-
Hi, I've setup a pause menu where the pause button changes the timescale to very slow, ie: Time.timescale = 0.0001f
And then I call a Tween Position animation that moves a pause menu onto the screen. I've found that in the editor this causes all of the buttons on the pause menu to stop working, but on an iOS device the same code works 95% of the time (5% of the time the same thing happens and the pause menu buttons don't work). The janky fix I've found for this is to add a 0.5 second delay before the timescale gets changed.
Any ideas on how to fix this so that the pause menu buttons don't freeze? (these are all located on the same panel as most of the other game UI and the panel is not static)
-
IgnoreTimeScale flag on your tweens must be checked, or they will obey timeScale rules.
Also -- why are you setting it to 0.0001f instead of just 0?
-
Yes, Ignore time scale is selected (hence the menu animates in just fine, even without the time delay).
I'm using 0.0001 because some other AI code gives me strange errors when the timescale is 0, so I'd rather not fool around with that stuff and the 0.0001 is just as effective at pausing.
-
It's not though. The game is still running, just very slowly. 0.0001 * 0.001 = very small number. You may be running into precision issues here.
-
Hello! I have exactly the same issue in my game :-\. I'm trying to use a 0.001f TimeScale...
Did you ever solve this problem? How did you? ???
Luis
-
luisdev/capitalj,
It might be better to have a singleton/global that sets a boolean for when the game is running or not, set this when pausing and then wrap any items/scripts that need to be 'paused' in a test of the boolean. Setting TimeScale to 0.0001f is going to cause pain...
Regards,
Mark
-
Thanks,
I ended up changing mi code so that I could use a 0 TimeScale ;D