- Home /
Coroutines are executed faster in Build
Hello, I've been working on a game project and am about to finish already and here's the problem I faced with after testing the build. Every motion that is executed by coroutines seems to be twice faster than it was in Unity playback. Everything else works fine, except for some minor glitches in UI that I'm fixing already. The problem started after I added custom button in Editor to delete PlayerPrefs in order to set game resolution to default.
Answer by sparkzbarca · Aug 09, 2015 at 03:41 AM
motion that you were doing in co-routines?
you weren't doing actual physical motion right?
like moving a character or bullet or gameobject or something?
Cause you can't do that outside of fixedupdate or lerp/slerping through update on a time.deltatime kinda thing.
are you talking about movement cause the thing is coroutines run as quickly as well they run, built exes will always run through the code faster than the editor so it'll run the code twice as fast get twice as many fps etc. Which is fine because if your using time.deltatime you'll still move the same speed, you'll move twice as often but half as far or half as often but twice as far etc.
Yes, I'm doing motions in coroutines.
No, I wasn't.
So I need to add Time.deltaTime multiplier in every coroutine motion to make it run at the right speed?
Yes! Otherwise your motion is variable (per-frame), not constant (per-second).
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Odd behavior changing another script's variable via coroutine 0 Answers
headbob in build too fast 1 Answer
Game too slow or too fast on Android 1 Answer
Game not working after build! 8 Answers