Can’t we just check if the actor is not on the pressure plate?
Seeing that IsOverlappingActor returns a bool.
The LastDoorOpenTime will not be greater than DoorCloseDelay so we will not close the door every tick anyway.
if (!PressurePlate->IsOverlappingActor(ActorThatOpens)) {
if (LastDoorOpenTime > DoorCloseDelay) {
CloseDoor();
}
}
EDIT:
Yeah okey, if we move out of the pressureplate to fast the doors will always stay open because the timer is not being updated anymore