Hello ! in the Tick part of the code :
// CurrentYaw is a value that is used for where the door is while its travelling between two points - the current Yaw rotation value and the target yaw rotation value. Using the Lerp() function (short for linear interpolation) that is contained in the FMath library , we are able to set CurrentYaw to a different value each tick - which makes the door open over time.
CurrentYaw = FMath::Lerp(CurrentYaw, TargetYaw, 0.02f);
// Here we create a Struct of type FRotator called DoorRotation and initialize it to the current actor’s rotation. The FRotator struct has a pitch, yaw, and a roll value, much like an FVector, but the FRotator is regarding rotation, not location.
FRotator DoorRotation = GetOwner()->GetActorRotation();
// We are going to use the “.” operator to access the yaw value of the DoorRotation struct we just created and set it to the value of CurrentYaw - this is what makes the door rotate along it’s yaw axis over time.
DoorRotation.Yaw = CurrentYaw;
// Finally, the function that ties it all together. We use SetActorRotation every tick with DoorRotation as the rotation value, which is changing with DeltaTime.
GetOwner()->SetActorRotation(DoorRotation);
So, anything that makes something move or needs to track movement usually has to take place in the tick , because movements happen frame-by-frame.