# I want to use "SimpleMoveToLocation" on Network

**URL:** <https://forums.unrealengine.com/t/i-want-to-use-simplemovetolocation-on-network/414376>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, dedicated-server, Navigation, unreal-engine, CPP, question\
**Created:** [January 12, 2018, 7:19am UTC](https://forums.unrealengine.com/t/i-want-to-use-simplemovetolocation-on-network/414376 "2018-01-12T07:19:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rexion\_ize](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rexion\_ize](https://forums.unrealengine.com/u/Rexion_ize)\
**Post date:** [January 12, 2018, 7:19am UTC](https://forums.unrealengine.com/t/i-want-to-use-simplemovetolocation-on-network/414376/1 "2018-01-12T07:19:23Z")

</div>

I’m making a kind of multiplayer game that my character moves to a point where I clicked. And it would be run on dedicated server.

So I set the NavigationMesh on the level, and checked “Project Settings-\>Navigation Systems-\>Allow Client Side Navigation”. And wrote movement code like this:

-MyPlayerController.cpp

```
void AMyPlayerController::MoveToClickedPoint()
{
    FHitResult OutHit;
    GetHitResultUnderCursorByChannel(ETraceTypeQuery::TraceTypeQuery1, false, OutHit);
    UNavigationSystem::SimpleMoveToLocation(this, OutHit.Location);
}

```

It works on a single-player mode but doesn’t on a dedicated server. So I tried an alternative way; build a path and make its pawn trace the path points.

-MyCharacter.cpp

```
void AMyCharacter::SetPath(UNavigationPath* NewNavigationPath)
{
    NavigationPath = NewNavigationPath;
    TargetPointIndex = 1;
}

void AMyCharacter::MoveToNextPoint()
{
    TArray<FVector> PathPoints = NavigationPath->PathPoints;

    // End of path
    if(PathPoints.Num() <= TargetPointIndex)
    {
        NavigationPath = nullptr;
        return;
    }

    FVector Dist = PathPoints[TargetPointIndex] - GetActorLocation();
    Dist.Z = 0.f;
    FVector TargetDirection = Dist.GetSafeNormal(MoveTolerance);

    if(TargetDirection.IsNearlyZero())
    {
        ++TargetPointIndex;
        // Recall itself to next step
        MoveToNextPathPoint();
    }
    else
    {
        AddMovementInput(TargetDirection);
    }
}

void AMyCharacter::Tick(float DeltaSeconds)
{
    Super::Tick(DeltaSeconds);

    if(NavigationPath)
    {
        MoveToNextPathPoint();
    }
}

```

-MyPlayerController.cpp

```
void AMyPlayerController::MoveToClickedPoint()
{
    FHitResult OutHit;
    GetHitResultUnderCursorByChannel(ETraceTypeQuery::TraceTypeQuery1, false, OutHit);
    UNavigationPath* NavigationPath = UNavigationSystem::FindPathToLocationSynchronously(GetWorld(), GetPawn()->GetActorLocation(), OutHit.Location);
    Cast<AMyCharacter>(GetPawn())->SetPath(NavigationPath);
}

```

It works fine on network but I want to use the “SimpleMoveToLocation”. Is there any way to use it? Should I use RPC? Or any other ways?

---

<div class="post-metadata">

**Author:** ![xlar8or](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xlar8or/32/710746_2.png) [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Post date:** [January 12, 2018, 11:55am UTC](https://forums.unrealengine.com/t/i-want-to-use-simplemovetolocation-on-network/414376/2 "2018-01-12T11:55:11Z")

</div>

Hey there, my guess is that the position and rotation of your character is being enforced by the server, so you might move in the cliente, but the server resets it again, so you might need a server rpc to run the SimpleMoveToLocation on the server so the position and rotation is replicated to the client.

---

<div class="post-metadata">

**Author:** ![MicroGame](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MicroGame](https://forums.unrealengine.com/u/MicroGame)\
**Post date:** [February 1, 2025, 9:26am UTC](https://forums.unrealengine.com/t/i-want-to-use-simplemovetolocation-on-network/414376/3 "2025-02-01T09:26:26Z")

</div>

Very important: don’t forget to set forget to set “Allow Client Side Navigation” to true in the Project Settings, else it will not work properly. The client must be allowed to do it’s movement.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [February 1, 2025, 8:41pm UTC](https://forums.unrealengine.com/t/i-want-to-use-simplemovetolocation-on-network/414376/4 "2025-02-01T20:41:02Z")

</div>

Have the client move, then rpc the server to move.
