# Delta Time Issue

**URL:** <https://forum.defold.com/t/delta-time-issue/10798>\
**Category:** Questions\
**Created:** [August 18, 2017, 3:45pm UTC](https://forum.defold.com/t/delta-time-issue/10798 "2017-08-18T15:45:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirkkaf13](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/kirkkaf13/32/5352_2.png) [@kirkkaf13](https://forum.defold.com/u/kirkkaf13)\
**Post date:** [August 18, 2017, 3:45pm UTC](https://forum.defold.com/t/delta-time-issue/10798/1 "2017-08-18T15:45:16Z")

</div>

Hello,

I am new around here, I started working with Defold a few days ago and impressed with my experience so far. I have decided to work through the tutorial to get a better feel for the elements involved with putting a game together.

Everything was well until the end of section 5 when I came to test my parallax scrolling background and my character running animation.

Firstly I was to set the background scrolling speed to 6, then setting my characters jump take off speed to 900 and a gravity value of -20. The background scrolls that fast it is a blur and my character won’t leave the ground when jumping unless I increase the jump speed to some value greater than 5000.

I thought I would try the plat-former game which was provided, that too also ran extremely quick, which got me looking into the delta time of the update function. I noticed in Defold Editor 2 the Dt variable is not set by default for this project and after ticking it, it resolved my issues with the plat-former demo.

After rushing back to my project I was only disappointed to find out that was not the issue I was experiencing there.

If anyone should shed some light on the issue or let me know what information they require to assist me that would be great.

Thanks.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [August 18, 2017, 5:09pm UTC](https://forum.defold.com/t/delta-time-issue/10798/2 "2017-08-18T17:09:41Z")

</div>

There’s a known issue with the engine on Windows (only?) where [certain gfx drivers misbehave and run faster than specified.](https://forum.defold.com/t/why-is-the-update-speed-too-fast-def-1785/1635/11) I believe we started looking into this a while back (@Johan_Beck-Noren?) but I can’t remember what we came up with.

But just to be clear: You’re moving things in `update()` and you use the `dt` to adjust the distance you move things?

---

<div class="post-metadata">

**Author:** ![kirkkaf13](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/kirkkaf13/32/5352_2.png) [@kirkkaf13](https://forum.defold.com/u/kirkkaf13)\
**Post date:** [August 27, 2017, 1:21pm UTC](https://forum.defold.com/t/delta-time-issue/10798/3 "2017-08-27T13:21:07Z")

</div>

Apologies for the delayed response. I am actually using Linux but I believe the issue was with the tutorial itself. It does not actually implement _dt_ within any update function of the ground script.

 ![image](https://forum-defold-uploads.b-cdn.net/original/2X/b/be6f8a429c28aed285077849de6cc755cc6e2fd7.png)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [August 27, 2017, 4:46pm UTC](https://forum.defold.com/t/delta-time-issue/10798/4 "2017-08-27T16:46:36Z")

</div>

Ah, yes, you’re right, the tutorial doesn’t make use of delta time. @sicher, surely that’s something we could improve on?

So, the solution would be to increase `self.speed` and then do:

```
pos.x = pos.x - self.speed * dt

```
