Door speed doesn't change

No matter what value I put in, the door opens really fast. I’m using UE 4.26. I also tried using Lerp(), FInterpConstantTo() and FinterpTo()

Here is my current code:

void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

	float CurrentyYaw = GetOwner()->GetActorRotation().Yaw;

	FRotator OpenDoor(0.f, 0.f, 0.f);

	OpenDoor.Yaw = FMath::FInterpTo(CurrentyYaw, TargetYaw, DeltaTime, 10);

	GetOwner()->SetActorRotation(OpenDoor);

}

Are you sure the component is attached to the door actor?

Hi Dan,

Thanks for replying. Yes, it’s attached to the actor. The only difference is that I used the door provided the StarterContent instead of the one you imported.
Please take a look at the screenshot.

Ah, I found my own mistake :man_facepalming:

I forgot to remove the code from BeginPlay(). So it was setting the door to 90 in the beginning.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms