FRotator flips from 90 to -90 degrees.

To rotate the actor, we implemented it using the code below.

However, a problem arose where the Roll rotation value stuttered at 90 and -90.

I solved it using FQuat, but I would like to know why that problem occurred.


MyActor.h

	UPROPERTY(VisibleAnywhere, Category = MyValue)
	FRotator currentRotation;

	UPROPERTY(EditAnywhere, Category = MyValue)
	FRotator rotateSpeed;

MyActor.cpp

void AMyActor::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
	Rotate(DeltaTime);
}

void AMyActor::Rotate(float DeltaTime)
{
	currentRotation = GetActorRotation();

	currentRotation += rotateSpeed * DeltaTime;
	SetActorRotation(currentRotation);
}

MyProject-UnrealEditor2024-04-2201-23-57-ezgif.com-video-to-gif-converter