I’m having problems understanding how we are storing the time when the door was last opened in the first if statement, and not the time when the world was brought up for play. Any help?
if (PressurePlate->IsOverlappingActor(ActorThatOpens))
// If the ActorThatOpens is in the volume
{
OpenDoor();
LastDoorOpenTime = GetWorld()->GetTimeSeconds();
}
// Check if its time to close the door
if (GetWorld()->GetTimeSeconds() - LastDoorOpenTime > DoorCloseDelay)
{
CloseDoor();
}
}