Hi everyone! So after completing the video on Using GetTimeSeconds(), my editor would crash as soon as I hit play. It didn’t take long to realize that it was the last addition - checking if enough time has passed to close the door then calling CloseDoor() - that was causing the crash. I’m not sure why, but I guess since the door is already at its closed rotation, it would cause the editor to crash.
To fix this issue, I added a safeguard by including a “DoorIsOpen” bool as private, setting it to false by default, toggling it when Open and CloseDoor() are called and having the TickComponent check for that too in the condition for closing the door. I figured I’d share it for posterity or in case anyone is suffering in silence and not being able to figure it out.
if (GetWorld()->GetTimeSeconds() - LastDoorOpenTime > DoorCloseDelay && DoorIsOpen)
{
CloseDoor();
}
I think that should illustrate the important part of my fix, but if the rest of it is needed/suggested, I’ll gladly include it on here.