Does adding deltatime to variable per tick work?

Hi All

I may have misunderstood deltatime, but I’m trying to make something happen after a specific amount of time, and deltatime appears to be running very fast.

I’m adding deltatime to a variable that starts at 0.0. Deltatime is added every tick. When it reaches 2.0, as far as I understand, that should be 2 seconds. However, it seems to be one second. If I change it to 4, it seems to execute after 2 seconds. Have I misunderstood something?

Thanks!

EDIT: I changed the execute variable to 10.0 and timed it and it’s running quite a lot faster than double speed. It crossed my mind- my card is a superclocked 780Ti. Would hardware have an effect on this?

Why don’t you use timers?

The count per tick happens under certain conditions- it can stop at any point if those conditions aren’t right. I think whats happening is a component that is counted per tick, is being counted more than once per tick, even though there’s only one of that type of component…

Yes it does. very accurately with no variation depending on graphics card etc. I was missing a return/break; in an earlier loop and the net result was that deltatime was being added more than once per tick…