Platform drift due to lag?

I think there might be a small bug here? Maybe I’m misunderstanding how the DeltaTime works though. It seems like DeltaTime is dynamic to the frame rate? So if there was lag spike between frames then the delta time would be larger?

If that’s true, then we can get larger than normal DeltaTime input during lag, then we’d compute a larger CurrentLocation to set the actor’s location with. That might set the platforms location farther beyond the maximum move distance than we wanted if we were right on the boundary of the max move distance. Since we then update the StartLocation with this farther than normal move distance, the platform won’t go all the way back to the right place. This error might compound over time if the game ran for a while and drift the platform away from it’s intended location.

Anyway, just looking for confirmation that I’m understanding this correctly! I tried to google for an answer on this, but all the information was how to use DeltaTime. I couldn’t find any information on if this value is dynamic with the systems actual frame rate (vs the intended frame rate)

2 Likes

That is correct and is explained and resolved in a future lecture.

1 Like

Thanks Dan! I noticed the next lecture resolved it, but left this here because I was curious about how the DeltaTime works. So my assumption with that was correct, DeltaTime will change based on the changing frame rate the PC is rendering at?

Yes as it’s the time between frames. You can set a max FPS in your project settings to see this.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms