# Player doesn't move on timed function with AddMovementInput

**URL:** <https://forums.unrealengine.com/t/player-doesnt-move-on-timed-function-with-addmovementinput/434219>\
**Category:** Character & Animation\
**Tags:** unreal-engine, question, CPP\
**Created:** [September 21, 2018, 2:54pm UTC](https://forums.unrealengine.com/t/player-doesnt-move-on-timed-function-with-addmovementinput/434219 "2018-09-21T14:54:53Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![WolfAlvein](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WolfAlvein](https://forums.unrealengine.com/u/WolfAlvein)\
**Post date:** [September 22, 2018, 10:48am UTC](https://forums.unrealengine.com/t/player-doesnt-move-on-timed-function-with-addmovementinput/434219/6 "2018-09-22T10:48:48Z")

</div>

So I was able to make him move and walk correctly by changing the code to look like this:

```
     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);
                 UCharacterMovementComponent* PM = PlayerCharacter->GetCharacterMovement();
		     PM->Velocity = PM->MaxWalkSpeed * PlayerForwadVector * 0.25;
             }
         }    
     }

```

It’s the only way I found that it worked correctly.

---

_[View the full topic](https://forums.unrealengine.com/t/player-doesnt-move-on-timed-function-with-addmovementinput/434219)._
