Why is my character getting stuck? (Gif and explanation in post)

My thought process was that if the rotation matches slope then the character movement component should traverse hills perfectly fine. Yet it gets stuck as seen in the gif and has similar issues going downhill too where it seems to get stuck and/or slow down even though I’ve set a constant speed for testing.

Here’s the code I used for tilting:

WARNING: Yes, it’s dirty and spaghetti. The purpose is to get it working and learn first, then optimize it.

void AMainPlayer::GetFrontTrace() {

	UCharacterMovementComponent* CharMoveComp = GetCharacterMovement();
	UCapsuleComponent* CapComp = GetCapsuleComponent();

	if (playerSkeleMesh != nullptr) {
		FVector StartLoc = playerSkeleMesh->GetSocketLocation("FrontTrace");
		FVector EndLoc = StartLoc + FVector(0.0f, 0.0f, -1000.0f);
		FCollisionQueryParams QueryParams;
		QueryParams.AddIgnoredActor(this);
	
		FHitResult HitResult;
		bool hit = GetWorld()->LineTraceSingleByChannel(HitResult, StartLoc, EndLoc, ECollisionChannel::ECC_Visibility, QueryParams);

		FVector ActRight = GetActorRightVector();
		FVector ActFor = GetActorForwardVector();
	 	FVector ActUp = GetActorUpVector();
		
		float OutPitch;
		float outAngle;
		UKismetMathLibrary::GetSlopeDegreeAngles(ActRight, HitResult.ImpactNormal, ActUp, OutPitch, outAngle);
		


		if (hit)
		{
			
			FRotator CapRot = GetActorRotation();
			float roll;
			float pitch;
			float yaw;
			float yzroll;
			float yzpitch;
			float yzyaw;
			float xzroll;
			float xzpitch;
			float xzyaw;
			UKismetMathLibrary::BreakRotator(CapRot, roll, pitch, yaw);
			FRotator YZRot = UKismetMathLibrary::MakeRotFromYZ(ActRight, HitResult.ImpactNormal);
			FRotator XZRot = UKismetMathLibrary::MakeRotFromXZ(ActFor, HitResult.ImpactNormal);
			UKismetMathLibrary::BreakRotator(YZRot, yzroll, yzpitch, yzyaw);
			UKismetMathLibrary::BreakRotator(XZRot, xzroll, xzpitch, xzyaw);
			FRotator NewRot = UKismetMathLibrary::MakeRotator(xzroll, yzpitch, yaw);
			float DeltaTime = GetWorld()->GetDeltaSeconds();
			FRotator GradualRot = UKismetMathLibrary::RInterpTo(CapRot, NewRot, DeltaTime,  5.0f);
			CapComp->SetWorldRotation(GradualRot);

			float zVal = outAngle;
			UE_LOG(LogTemp, Warning, TEXT("Front Val: %f"), speed);
		}
		else {
			UE_LOG(LogTemp, Warning, TEXT("No Hit"));
		}

	}
	else
	{
		UE_LOG(LogTemp, Warning, TEXT("Mesh not found"));
	}
}

The function is called on Tick.

I’m having trouble even quite understanding what’s going wrong. It kinda looks like the player is clipping and getting stuck in the terrain even? Part of the end goal is for the player to be able to jump off halfpipes so it’s pretty important. Any insight would be greatly appreciated.

how about increase increase walkable floor angle (SetWalkableFloorAngle) of the character movement component

I’ve tried that. Set it to 90. It doesn’t change anything. I think since the capsule is being rotated to the angle, the walkable angle is essentially 0 the whole time.