> ## Documentation Index
> Fetch the complete documentation index at: https://udcore.unrealdirective.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI

### MoveToLocation

Moves the actor to the specified location. When the movement has succeeded or failed, the Completed delegate is called with success/failure.

<Tabs>
  <Tab title="Blueprint">
    <Frame type="glass">
      <img src="https://mintcdn.com/unrealdirective/rXPzDrZHlafDpvFa/images/blueprints/blueprint-movetolocation.jpg?fit=max&auto=format&n=rXPzDrZHlafDpvFa&q=85&s=bf5451b57ebf4e8084bc7e8e5ca7c09b" width="850" height="360" data-path="images/blueprints/blueprint-movetolocation.jpg" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    #include "AI/UDAT_MoveToLocation.h"
    #include "GameFramework/Controller.h"
    #include "GameFramework/Actor.h"

    void AExampleCharacter::MovePlayerToLocation()
    {
        UWorld* World = GetWorld();
        AController* Controller = GetController();
        const FVector Destination(100.0f, 200.0f, 300.0f);
        constexpr float AcceptanceRadius = 100.0f;
        constexpr bool bDebugLineTrace = false;

        UUDAT_MoveToLocation* MoveToLocationTask = UUDAT_MoveToLocation::MoveToLocation(
            World,
            Controller,
            Destination,
            AcceptanceRadius,
            bDebugLineTrace);

        if (MoveToLocationTask)
        {
            MoveToLocationTask->Completed.AddDynamic(this, &ThisClass::OnMoveToLocationCompleted);
        }
    }

    void AExampleCharacter::OnMoveToLocationCompleted(bool bSuccess)
    {
        // Called when UUDAT_MoveToLocation has completed with either a success or fail.
        // Add your logic here.
    }
    ```
  </Tab>
</Tabs>

**Inputs**

<ParamField path="WorldContextObject" type="UObject*" required>
  The world context object.
</ParamField>

<ParamField path="Controller" type="AController*" required>
  The controller to move.
</ParamField>

<ParamField path="Destination" type="FVector" required>
  The vector location to move to.
</ParamField>

<ParamField path="AcceptanceRadius" type="float">
  The radius around the destination location that is considered acceptable. Be sure to set this to a reasonable value as the controller may never reach the exact destination.

  * Default: 100.f
</ParamField>

<ParamField path="bDebugLineTrace" type="bool">
  Display a line trace to the destination location for a short duration.
</ParamField>

**Outputs**

<ParamField path="ReturnValue" type="UUDAT_MoveToLocation*">
  The async task instance.
</ParamField>
