- Home /
Why Time.Deltatime is slowing movement
Hey i have been trying to add a movement to the character in 2D space. The code is working perfectly. I have heard that using Time.DeltaTime is used to make the perticular action frame rate indepented. So i have added time.Delta time at the end of the movement code. But when i add the Time.Deltatime in the code it's slowing down the movement and also the charatcer feeling so jerky!.When i remove it, it's working fine. Why is that happening ..
[1]: /storage/temp/186853-doubt.png
Answer by xxmariofer · Sep 29, 2021 at 12:37 PM
Remove the time.deltatime, if your game is runnning at 60fps, time.deltatime will return 0,016666666. thats why its slowing your movement. But the way you are moving the rigidbody is allready framerate independant, because physics runns at a fixed rate
also @UVve818 use FIxedUpdate instead of update since physics works on a separate cycle in fixed update...and so physics objects like rigidbody based controllers should be used in fixed update
thats true, but in this specific case, is better to simply stick with Update. Inputs should be catched during update, if he used fixedupdate, he could be missing input events or triggering multiple inputs per frame, if he was for example using
rb.AddForce()...
or other method that are physics dependant then that should be moved to the fixedupdate. but because he is only changing the velocity value it doesnt matter if he is changing the velocity 4 times per physics cycle (in case he was having really high framerates)
Your answer
![](https://koobas.hobune.stream/wayback/20220613043612im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Delay Player From Using Action Button For A Period Of Time 0 Answers
Why does resetTimer act counter-intuitively? 2 Answers
Android and Time.DeltaTime 0 Answers
Digital Clock Needed For New UI Text 1 Answer
How do I fix this cooldown? 1 Answer