- Home /
headbob in build too fast
Hey there!
I have a very strange problem, I am using the headbob script on a first person controller's camera found on the wiki(http://www.unifycommunity.com/wiki/index.php?title=Headbobber) and it works perfectly when I'm in the editor, but if I build and run it ,it goes super fast!
The only thing I can think of is if it runs off frame time and not true time, and where in the build it has better fps
any idea why this is happening?
Thanks!
Answer by Jesse Anders · Jan 19, 2011 at 01:19 AM
It doesn't look like that code is framerate-independent. I only glanced over it, but you might try changing this:
timer = timer + bobbingSpeed;
To this:
timer += bobbingSpeed * Time.deltaTime;
And then readjust 'bobbingSpeed' as necessary. (Note that the change from + to += is unrelated to the timing issue.)
Your answer
![](https://koobas.hobune.stream/wayback/20220613100039im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Build Speed is slow after unity3d was updated to 3.5.5f2 2 Answers
Coroutines are executed faster in Build 1 Answer
Uploading a single WebGL file 0 Answers
Game too slow or too fast on Android 1 Answer