- Home /
Time.realtimeSinceStartup returns negative number
Hello,
I'm porting an iPhone game to Android. The game will feature a 3rd part social integration (papayamobile) as a plugin, but when I go to papaya and then go back to the game, the game consistently becomes very very slow.
Time.time increases with 0.00001 each update() Time.realtimeSinceStartup is a negative number: have had -5.161479, -3.03something Time.timeScale is 1 at all times.
I've had this phenomenon happen before papaya, where it happened by just putting the app in the background and going back to it later - I've not been able to reproduce it that way though. Papaya triggers it consistently.
I'm thinking that it's an onResume that doesn't trigger something right, but I'm not sure on how and why.
Does anyone have any good ideas to what I can do? Time.realtimeSinceStartup is used quite a lot throughout the game, so this is essentially a game-breaker.
Can I "jump start" the timer again when my application returns to active?
Answer by gwiz665 · Jul 05, 2011 at 03:04 PM
I have been told that this is fixed in Unity 3.4. I guess I'll just have to wait.
It has not been fixed in Unity 3.4. Would be interested in knowing why this issue exists.
Answer by RMGK · Sep 29, 2011 at 05:01 AM
Nope, I'm still getting this problem. Solutions Unity staff people?
Answer by RMGK · Sep 29, 2011 at 06:04 PM
I eventually used DateTime.Now to get the system time and DateTime.Now.Subtract(oTime).TotalSeconds to get the delta time in seconds to mimic what I was doing with Time.realtimeSinceStartup.
Your answer
Follow this Question
Related Questions
Real time and slider values 1 Answer
how to make a varied countdown timer 1 Answer
Help with time.time when new scene starts. 1 Answer
How can I add time to a timer on an object collision? 1 Answer
Help with SpeedRun personal best script 0 Answers