Timeline for Is Time.deltaTime framerate dependent?
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 26, 2016 at 7:45 | comment | added | user3078100 | I must admit I didn't know that was how it worked. But it wasn't my desired behavior. I prefer the script as is. Thanks for the explanation, I learned a lot about Time.deltatime. | |
Aug 25, 2016 at 16:54 | comment | added | user1430 | I missed that DMGregory, good catch. @user3078100 is that an accurate description of your desired behavior? | |
Aug 25, 2016 at 16:14 | comment | added | DMGregory♦ | The original code does something a bit different, since it's not adding deltaTime to score, but adding total time. That means score goes up non-linearly, increasing faster and faster the longer the level runs. If that was deliberate, then we'd probably want to accumulate a levelTime value, and then compute score as a nonlinear function of levelTime, rather than try to accumulate score directly. | |
Aug 25, 2016 at 16:13 | history | edited | user1430 | CC BY-SA 3.0 |
added 163 characters in body
|
Aug 25, 2016 at 16:12 | comment | added | Gnemlock |
Time.deltaTime retrieves seconds since last update. That means when deltaTime is not less than one, it took more than a second to process the last frame. Wouldn't that suggest problems, itself?
|
|
Aug 25, 2016 at 16:10 | vote | accept | user3078100 | ||
Aug 25, 2016 at 16:10 | comment | added | Leggy7 | @user3078100 you did it wrong. time -= 1.0f, not score | |
Aug 25, 2016 at 16:09 | history | edited | user1430 | CC BY-SA 3.0 |
added 251 characters in body
|
Aug 25, 2016 at 16:01 | comment | added | user3078100 | I can't seem to make it work. It just stays at zero. I added the full code. | |
Aug 25, 2016 at 15:32 | history | answered | user1430 | CC BY-SA 3.0 |