[Help] EnhancedInputSystem MouseLook stops at window boundary

I am working on camera controls while the LMB is held down.

Things are pretty smooth, until the mouse hits the window boundary at which point the rotation abruptly halts and it feels jarring.

What I would like is to have the mouse continue updating with new coordinates even though it is trapped in the window bounds.

Here’s the Controller setup:

void AVirtuePlayerController::BeginPlay()
{
	Super::BeginPlay();
	check(VirtueContext);

	UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer());
	check(Subsystem);
	Subsystem->AddMappingContext(VirtueContext, 0);

	bShowMouseCursor = true;
	DefaultMouseCursor = EMouseCursor::Default;

	FInputModeGameAndUI InputModeData;
	InputModeData.SetLockMouseToViewportBehavior(EMouseLockMode::DoNotLock);
	InputModeData.SetHideCursorDuringCapture(false);
	
	SetInputMode(InputModeData);

	VirtueCharacter = CastChecked<AVirtueCharacter>(GetCharacter());
}

void AVirtuePlayerController::SetupInputComponent()
{
	Super::SetupInputComponent();

	UEnhancedInputComponent* EnhancedInputComponent = CastChecked<UEnhancedInputComponent>(InputComponent);

	EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AVirtuePlayerController::Move);
	EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AVirtuePlayerController::Look);
	EnhancedInputComponent->BindAction(TurnAction, ETriggerEvent::Triggered, this, &AVirtuePlayerController::Turn);
	EnhancedInputComponent->BindAction(RotateAction, ETriggerEvent::Triggered, this, &AVirtuePlayerController::Rotate);
}

IA_Look is bound to pressed or release LMB:


void AVirtuePlayerController::Look(const FInputActionValue& InputActionValue)
{
	if (InputActionValue.Get<bool>())
	{
		bShowMouseCursor = false;
		SetIgnoreLookInput(false);
		bIsLooking = true;
		VirtueCharacter->EnableCameraOrbit(true);
	}
	else
	{
		bShowMouseCursor = true;
		SetIgnoreLookInput(true);
		bIsLooking = false;
		VirtueCharacter->EnableCameraOrbit(false);
	}
}

The Rotate input action is bound to the Mouse XY axis:

void AVirtuePlayerController::Rotate(const FInputActionValue& InputActionValue)
{	
	FVector2D LookAxisVector = InputActionValue.Get<FVector2D>();
	if (bIsLooking)
	{ 
		VirtueCharacter->OrbitCamera(LookAxisVector);
	}
	if (bIsTurning)
	{
		if (APawn* ControlledPawn = GetPawn<APawn>())
		{
			ControlledPawn->AddControllerPitchInput(LookAxisVector.Y);
			ControlledPawn->AddControllerYawInput(LookAxisVector.X);
		}
	}
}

the character OrbitCamera is pretty simple.

It sets Quaternions for the initial camera rotation and the target camera rotation and sets a float to 0.f to track the duration of the rotation.

On tick in the character it checks if it needs to rotate and if so, it just slerps the camera spring arm between initial and target quaternions over a period of time (default is .5s)

I think this is going to come down to some setting that is locking the mouse cursor to the window bounds, but I thought that maybe this line in BeginPlay would fix that:

	InputModeData.SetLockMouseToViewportBehavior(EMouseLockMode::DoNotLock);

Thanks for reading all of that! If you have ideas, thank you even harder.