MoveToLocation does not move pawn

I want to move pawn with mouse. A possess pawn by AMyAiController : public AAIController and onClick I’m trying to move it with MoveToLocation(...) but call to this function only rotates pawn, but does not move it. UNavigationSystem::SimpleMoveToLocation(...) does same thing.

What am I doing wrong?

Thanks!

First of all make sure you have navmesh on your map (place a NavMeshBoundsVolume on your map). If this doesn’t help try using Character rather than a Pawn.

Hope it helps.

–mieszko

I have NavMeshBoundsVolume. How can I posses character and not pawn by controller?

I had a similar issue with the MoveTo task of the behavior tree.
It did not work with a pawn, but with a character, it does :slight_smile:

Edit: no, i was wrong.
The problem was the fact that the I added a mesh component to the entity, which had collision, so there was an unreachable area around its location, (the navmesh was updated).

I had the same problem. This took me 8 hours to figure out.

The problem:

  • I had removed the static mesh that is supplied with ACharacter. By doing so, my MovementComponent had no rigid body to work with.
  • Instead of the static mesh, i had put in a skeletal mesh, so assumed it would be okay.

The solution:

  • Put the static mesh back in, the one that comes default with ACharacter and just leave all default settings for it
  • The player will still not move if you still have the skeletal mesh, until you go to the skeletal mesh and disable physics on it. Untick “Enable physics on dedic…”.

286292-image-2019-08-31t23-05-03-692z.png

Reason:

  • No idea, i haven’t looked into why. If anyone knows, that’d be awesome.