1
\$\begingroup\$

I try to move a character with AI MoveTo, but it always fails. I tried to do this with standart ThirdPersonController and a custom one. The blueprint is simple ThirdPersonController

When the event happens, it starts printing "failed". I checked many times if I have a NavMesh on the level or any other problems with it, but I don't think there are any problems with that. Any ideas?

\$\endgroup\$
4
  • \$\begingroup\$ Is your character possesed by AIController? \$\endgroup\$
    – ColdSteel
    May 18, 2020 at 20:19
  • \$\begingroup\$ Does it have a valid movement component? \$\endgroup\$
    – ColdSteel
    May 18, 2020 at 20:19
  • \$\begingroup\$ Yes and yes. I double-checked \$\endgroup\$
    – stdnik
    May 18, 2020 at 21:34
  • \$\begingroup\$ Try to open an output log and see if there is something that tells you why is it fails \$\endgroup\$
    – ColdSteel
    May 18, 2020 at 22:10

6 Answers 6

1
\$\begingroup\$

There's a few things that can cause this. Also, yes, it's normal to be frustrated with the AIMoveTo node, as it can be finicky. Your AIMoveTo node does not have a destination. Instead, try to drag off the As First Person Character and get the actor's world location. You should try inputting that into the Destination field on the AIMoveTo node.

If this doesn't help, make sure your AI pawn is possessed by AI (you can check this in the class (self) details under a field called Auto Possess AI.

One more thing, is the OnSeePawn event firing? It might be having issues seeing you.

I'm assuming the issue is the destination field, though. Keep me updated with this! I want to make sure you get this resolved.

\$\endgroup\$
1
  • \$\begingroup\$ I connected the print string node to Ai Move To the "exec" out pin and I send there the "Movement Result" from AI Move To. Each time I launch the game when this pawn starts seeing me, it prints "success" once and then starts spamming "aborted", but the pawn doesn't move. I've checked everything you mentioned and everything is alright there. Could it be that I have some kind of bad project or map configuration? I've tried moving, removing and adding again the navmesh, but nothing changed \$\endgroup\$
    – stdnik
    May 19, 2020 at 20:09
1
\$\begingroup\$

Long story short: there was some problem with the map, so I just started using another one. Don't know what caused the problem, but it was definitely in the map.

\$\endgroup\$
1
  • \$\begingroup\$ Hello! If this fixed the error and is the solution to your issue, please consider marking the answer as the accepted one :) \$\endgroup\$
    – Vaillancourt
    Jun 19, 2020 at 0:05
1
\$\begingroup\$

I had the same problem with my project. Suddenly my AI stopped working.

By just selecting the nav mesh volume and changing anything(like a minor adjust in x scale, for example) made it work again.

Maybe Nav Mesh need some kind of refresh after some change in the project.

\$\endgroup\$
1
\$\begingroup\$

I had the same exact problem. I killed the NavMesh, deleted it, and deleted the NavRecast. The recast returned automatically, I made a new NavMesh and that did it.

\$\endgroup\$
0
\$\begingroup\$

One solution I found actually had to do with the RunPhysicsWithNoController boolean in the CharacterMovementComponent. I spawn my AI from the gamemode to populate servers that are below max player count, and I found that having that boolean as true keeps the character from moving.

\$\endgroup\$
0
\$\begingroup\$

I had the same issue for a few days and I just fixed it. If you're interested the issue was that RecastNavMesh had Runtime.CanBeMainNavData turned off by default, when I turned it on the AI started to move again. I hope this will help anyone.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .