Getting Player to move along wall? Cover System

I’m working on creating a third person cover system to demo.

The character currently has 1 line trace running out of his face. The linetrace is red by default and turns green when it hits an object that has been deemed “coverable” (meaning you can take cover on it.) Then, by hitting the ‘Z’ key, the player should attach to the wall and have his movement constrained to the boundaries of the wall (kind of like Gears of War or Mass Effect.)

I’m having trouble thinking of the best implementation to get the player to attach to the wall, and then have his movement constrained so he stays on the wall. Any help would be appreciated, thanks!

Code for reference. All this does is the changing of the tracer between green and red. I had code for getting the character to the wall (using attachrootcomponenttoactor) but it was terrible:

void ATPSCharacter::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
	if (Controller && Controller->IsLocalPlayerController())
	{
		FVector CamLoc;
		FRotator CamRot;

		Controller->GetActorEyesViewPoint(CamLoc, CamRot);
		const FVector StartTrace = CamLoc;
		const FVector Direction = CamRot.Vector();
		const FVector EndTrace = StartTrace + Direction * 1500;
															   
		FCollisionQueryParams TraceParams(FName(TEXT("WeaponTrace")), true, this);
		TraceParams.bTraceAsyncScene = true;
		TraceParams.bReturnPhysicalMaterial = true;

		FHitResult Hit(ForceInit);
		GetWorld()->LineTraceSingle(Hit, StartTrace, EndTrace, COLLISION_WEAPON, TraceParams);

		ACoverable* coverable = Cast<ACoverable>(Hit.GetActor());
		if (coverable) 
		{
			DrawDebugLine(GetWorld(), StartTrace, EndTrace, FColor(0, 255, 0), false, -1, 0, 4);
		}
		else
		{
			DrawDebugLine(GetWorld(), StartTrace, EndTrace, FColor(255, 0, 0), false, -1, 0, 4);
		}
	}
}