Это основанный на кадре, не отмеченный меткой времени. Вы можете проверить это сами. Создайте новый класс C ++> Character. В Visual Studio в этом классе найдите Tick () и измените его следующим образом:
void NameOfClass::Tick(float DeltaTime)
Super::Tick(DeltaTime);
if (GetWorld() != nullptr)
{
UE_LOG(LogTemp, Warning, TEXT("DeltaTime of Frame: %f"), GetWorld()->TimeSeconds)// Returns time in seconds since world was brought up for play, IS stopped when game pauses, IS dilated/clamped
UE_LOG(LogTemp, Warning, TEXT("DeltaTime of Frame FDateTime ms: %f"), FDateTime::Now().GetMillisecond())// Gets the local date and time on this computer.
}
Затем найдите одну из функций ввода, например Jump (), и измените ее следующим образом:
void NameOfClass::Jump()
{
Super::Jump();
if (GetWorld() != nullptr)
{
UE_LOG(LogTemp, Warning, TEXT("DeltaTime of Jump: %f"), GetWorld()->TimeSeconds)// Returns time in seconds since world was brought up for play, IS stopped when game pauses, IS dilated/clamped
UE_LOG(LogTemp, Warning, TEXT("DeltaTime of Jump FDateTime ms: %f"), FDateTime::Now().GetMillisecond())// Gets the local date and time on this computer.
}
}
Не забывайте #include для UWorld в верхней части. cpp
#include "Runtime/Engine/Classes/Engine/World.h"
COMPILE. В редакторе UE4Editor перетащите класс на свой уровень, нажмите play, и вы увидите, что происходит DeltaTime каждого кадра. Если вы нажмете пробел (по умолчанию вызывается Jump ()) и сразу ES C, чтобы остановить игру, вы можете сравнить 2 DeltaTimes. Идентичные! Я надеюсь, что это отвечает на ваш вопрос.