Reproduce the "MoveComponentTo" blueprint function in C++ with the UKismetSystemLibrary::MoveComponentTo function

Currently, I have this blueprint connected to the move and stop pin.
image

So I thought I’d write the function twice to get the Move and Stop conditions. The StopZipline event should be triggered when I press a certain key. However, it can only occur when the Move section has finished.
I have the impression that with MoveComponentTo you can only set one “MoveAction” parameter. Wouldn’t there be a way to merge the 2 lines into one, like with the blueprint?
(Simplified code below)

void UZiplineComponent::UseZipline()
{ 
if (Cast<APlayerController>(PlayerCharacter->GetController())->WasInputKeyJustPressed(EKeys::E)) {
PlayerCharacter->GetCharacterMovement()->SetMovementMode(MOVE_Flying);

FLatentActionInfo LatentInfo;
LatentInfo.CallbackTarget = this;
LatentInfo.ExecutionFunction = FName("MoveToTargetFinished");
LatentInfo.Linkage = 0;
LatentInfo.UUID = 0;

FLatentActionInfo StopCondition;
StopCondition.CallbackTarget = this;
StopCondition.ExecutionFunction = "StopZipline";
StopCondition.Linkage = 0;
StopCondition.UUID = 1;

UKismetSystemLibrary::MoveComponentTo(PlayerCharacter->GetCapsuleComponent(), RelativeLocation, RelativeRotation,
false, false, OverTime, true, EMoveComponentAction::Move, LatentInfo);

UKismetSystemLibrary::MoveComponentTo(PlayerCharacter->GetCapsuleComponent(), RelativeLocation, RelativeRotation, 
false, false, OverTime, true, EMoveComponentAction::Stop, StopCondition);

}
}
}

void UZiplineComponent::JumpDuringZipline()
{ if (Cast<APlayerController>(PlayerCharacter->GetController())->WasInputKeyJustPressed(EKeys::SpaceBar)) { if (!PlayerCharacter->GetCharacterMovement()->IsFalling() && bOnZipline) { StopZipline();
UKismetSystemLibrary::RetriggerableDelay(this, 0.0001, FLatentActionInfo{});

PlayerCharacter->GetCharacterMovement()->SetMovementMode(MOVE_Falling);

//Changer les valeur pour controler la vitesse du saut
const FVector Velocity = PlayerCharacter->GetActorForwardVector() * 2500 + PlayerCharacter->GetActorUpVector() * 900.f;
PlayerCharacter->LaunchCharacter(Velocity, true, true);
}
}
}

void UZiplineComponent::MoveToTargetFinished()
{
PlayerCharacter->GetCharacterMovement()->SetMovementMode(MOVE_Walking);

UKismetSystemLibrary::K2_ClearAndInvalidateTimerHandle(this, Timer);

bOnZipline = false;
}

void UZiplineComponent::StopZipline()
{ UE_LOG(LogTemp, Warning, TEXT("Stop Zipline")); }

void UZiplineComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{ Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
UseZipline();
JumpDuringZipline();
}

Your StopZipline function would have to be a different function, or your UseZipline function would need to have an argument to know if it’s start or stop

Once you create a StopZipline function, use the same call but with Stop instead of Move as the action. It is important to have the same UUID in your FLatentActionInfo, so that the correct move can be stopped

UKismetSystemLibrary::MoveComponentTo(PlayerCharacter->GetCapsuleComponent(), RelativeLocation, RelativeRotation,
false, false, OverTime, true, EMoveComponentAction::Stop, LatentInfo);

The other arguments are not important, since nothing else is used when the action is Stop

You can see the relevant code in KismetSystemLibrary.cpp:2536 and 2572