i wrote the exact code that was typed in video but for some reason there is no sound at all
and here is a piece of code to insure :
void UOpenDoor::OpenDoor(float DeltaTime)
{
CurrentOpenYaw =FMath::Lerp(CurrentOpenYaw, TargetOpenYaw, DeltaTime * DoorOpenSpeed);
FRotator DoorRotation = GetOwner()->GetActorRotation();
DoorRotation.Yaw = CurrentOpenYaw;
GetOwner()->SetActorRotation(DoorRotation);
CloseDoorSound = false;
if(!AudioComponent){return;}
if (!OpenDoorSound)
{
AudioComponent->Play();
OpenDoorSound = true;
}
}
void UOpenDoor::CloseDoor(float DeltaTime)
{
CurrentOpenYaw =FMath::Lerp(CurrentOpenYaw, InitialOpenYaw, DeltaTime * DoorCloseSpeed);
FRotator DoorRotation = GetOwner()->GetActorRotation();
DoorRotation.Yaw = CurrentOpenYaw;
GetOwner()->SetActorRotation(DoorRotation);
OpenDoorSound = false;
if(!AudioComponent){return;}
if(!CloseDoorSound)
{
AudioComponent->Play();
CloseDoorSound = true;
}
}