Hey guys.
I’m using the standard moving command to make the player walk left and right correctly and without any problem, has shone in the GIF bellow
Has you can see, when I arrive to the Prop, I press the button up (has shown in the widget), but for some reason even though I have the timer to execute continually and send the same 1.0 multiplier to make the character walk towards the Prop, the player only skids there very slowly.
Do you guys have any idea of how to solve this issue?? this code is being executed in my Custom Player Controller
here is the code that makes the player turn towards the prop and walk:
void AUserController::MoveCharacterAutomaticallyToProp(FVector StartMovePoint, FBox MeshCompBox)
{
AActor* InteractiveActor = PlayerCharacter->GetInteractiveActor();
if (InteractiveActor != nullptr && !InteractiveActor->IsPendingKill())
{
UStaticMeshComponent* PropMesh = Cast<UStaticMeshComponent>(InteractiveActor->GetRootComponent());
if (PropMesh != nullptr && !PropMesh->IsPendingKill())
{
if (OriginalPlayerRotation == FRotator::ZeroRotator)
{
OriginalPlayerRotation = PlayerCharacter->GetActorRotation();
}
FVector CurrentPlayerLocation = PlayerCharacter->GetActorLocation();
FVector PropLocation = PropMesh->GetComponentLocation();
FVector PropDirection = (PropLocation - CurrentPlayerLocation);
PropDirection = FVector(PropDirection.X, PropDirection.Y, 0.0f);
PropDirection.Normalize();
FRotator NewPlayerRotation = FMath::Lerp(PlayerCharacter->GetActorRotation(), PropDirection.Rotation(), 0.075);
SetControlRotation(NewPlayerRotation);
PlayerCharacter->AddMovementInput(PlayerCharacter->GetActorForwardVector(), 1.0);
}
}
}
And this is the code that I use to make the player walk normally with the control pad:
void AUserController::MoveRight(float value)
{
if (PlayerCharacter != nullptr && !PlayerCharacter->IsPendingKill())
{
PlayerCharacter->AddMovementInput(PlayerCharacter->GetActorForwardVector(), value);
}
}
Has you can see it’s all the same, the only thing is that I change the value for the 1.0 multiplier.