Hi! Really enjoying the course so far.
One comment about that lecture. It seems to me one bool suffices:
OpenDoor.h
private:
bool DoorIsOpen = false;
OpenDoor.cpp
void UOpenDoor::OpenDoor(float DeltaTime)
{
if (!DoorActor) {return;}
if (!DoorIsOpen && AudioComponent) {
AudioComponent->Play();
}
DoorIsOpen = true
// ...
}
void UOpenDoor::CloseDoor(float DeltaTime)
{
if (!DoorActor) {return;}
if (DoorIsOpen && AudioComponent) {
AudioComponent->Play();
}
DoorIsOpen = false;
// ...
}