Hello,
i solved the if statemant in another way like this and it works:
if (GetWorld()->GetTimeSeconds() >= DoorLastOpend + DoorCloseDelay)
{
CloseDoor(DeltaTime);
}
In the first view it does exactly the same. So it is OK for me.
I´m a beginner in programming and i asked myself: Is there a fundamental reason why doing it your way?
By adding numbers (like i did) numbers may become large. You used a way of substraction. Is it preffered because of i.e. memory usage, avoiding to reach the end of “int” or “float” range? But then GetTimeSeconds() would have the same problem, right?
Or doesn´t matter it, because it is trivial?
Thanks