In C + +, the tick deltime is zero

屏幕截图 2022-08-27 140204

  • List item

Hi, welcome to the forum.

In your code example, you are missing the variable name in the LOG statement. At least, you should add the variable name for the format to print successfully. So first check, that this is correct. I’m sure, the DeltaTime will show correctly then. Any problems you have are for sure not caused by a zero DeltaTime.

// some example
UE_LOG(LogTemp, Warning, TEXT("value = %f"), DeltaTime);

Another thing - I believe you want to use

// inc runtime
RunTime += DeltaTime;

This most likely causes the problem you have, getting always the same (very small) RunTime value, looking like it is Zero, so your actor does not swing up and down as expected. In combination with the bad UE_LOG, this causes confusion.

And of course make sure, that B is not zero as well…