Strange behaviour I’m encountering at the moment with some counters counting down faster than they should when playing on my Android Device from an APK file.
I have a “slow down time” ability in my endless runner. You can only use this for “foo” duration. To update the players current “foo” amount, I do the current “foo” -= Time.unscaledDeltaTime; This works fine in unity. I used unscaled because I want foo to reduce per second, rather than every 2 seconds (since slow down time sets time.timescale to 0.5f.
When I try this on my installed APK on an android device (other devices have the behaviour too), instead of “foo” being reduced by 1 per second, it seems to be about double that. The game however runs at the same speed (from some testing running unity and phone at same time, the player move through the world at same speed). What’s even more odd, is when I jump during slowdown, it makes the “foo” reduce even faster! All my jump is doing is adding velocity to the rigidbody attached to the player until a separate timer (that counts down how long you can jump for) reaches 0. That timer uses deltaTime, as I want the jump duration to be affected by the slow down (otherwise you’d be able to jump less high during slow down mode).
I tried replacing unscaled delta time by Time.UnscaledTime instead, and manually calculating each update cycle the difference between last frames unscaledTime and this frames unscaledTime, but it resulted in the same behaviour when exported to APK and run on an Android device.
Has anyone encountered something and have some advice? This is my first game and I really want to try and get it closer to release but this is causing big playability issues right now for me. Thanks kindly in advance for anyone who reads and contributes.