Download

Is there any difference between GetDeltaSeconds() and DeltaTimeSeconds?

I mean, is there any difference that I am missing? Can I use whatever I want when I want? It just looks weird/suspicious that you can access the same value in 2 different ways, directly and thru a function, so that’s why I am asking.

float DeltaTimeSeconds Frame delta time in seconds adjusted by e.g. time dilation.
float GetDeltaSeconds() Returns the frame delta time in seconds adjusted by e.g. time dilation.

source code says

FORCEINLINE_DEBUGGABLE float UWorld::GetDeltaSeconds() const
{
return DeltaTimeSeconds;
}

so it doesn’t appear to make a difference

1 Like

In debug mode you may be able to put a breakpoint on a function access, which you cannot on a global variable. If you need to know everyone who reads time, and when they do it, the function makes that easier to find out.

1 Like

Now it makes more sense. Basically there isn’t difference, but it is better to use GetDeltaSeconds() since it allows to use a breakpoint while debugging.

Thanks to both of you.