Hello all, so what is the purpose of removing the code associated with the LastDoorOpenTime and DoorCloseDelay variables? I know Ben said it is to remove code that is being superseded by the Blueprint, however it really is not (at least not easily), as the OnOpen and OnClose define how the door is opening/closing, but does not allow for a delay between when the door opens and when it closes… However if you leave the following associated with the code, then you can literally play test the game to have the door slam in your face still. The code block is as follows:
From OpenDoor.cpp
//Poll the Trigger Volume
if (GetTotalMassOfActorsOnPlate()> TriggerMass)
{
OnOpenRequest.Broadcast();
LastDoorOpenTime = GetWorld()->GetTimeSeconds(); //Advised to get rid of by Ben
};
if(GetWorld()->GetTimeSeconds() - LastDoorOpenTime > DoorCloseDelay) //Advised to get rid of/alter by Ben
{
OnCloseRequest.Broadcast();
}
}
From OpenDoor.h
UPROPERTY(EditAnywhere)
float DoorCloseDelay = 0.f; //Advised to get rid of by Ben
float LastDoorOpenTime; //Advised to get rid of by Ben
Thanks, and I hope that someone can help clarify this!