My door opening slowly

Here’s my function implementation of the opening door.

void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
	
	FRotator CurrentRotation = GetOwner()->GetActorRotation();
		
	CurrentRotation.Yaw = FMath::Lerp(CurrentRotation.Yaw, TargetYaw, 0.01f);
	GetOwner()->SetActorRotation(CurrentRotation);
}

You are only opening the door by 1% of the remaining degrees each frame.
Assuming your target is 90 degrees, that means on the first frame you open your door by 0.9 degrees, on the second frame by 0.891 degrees and so on. Simply inrcrease that rate to something like 0.1f maybe.
That should get you close to 90 degrees within around 50 frames.

Privacy & Terms