Allow partial path seems to be broken on 4.22.2

if the target location is outside the navigation path, AI wont move even when the allow partial path is on,

We understood that “allow partial path” means that the AI will find the closest point if it “can’t” reach the target point! Is this what “allow partial path” supposed to do ?

Just to confirm, AI is working if the target path is inside navigation systtem.

1 Like

This still seems to be an issue in 4.22.3

I run into the same issue in 4.23.0, hope Epic fix it soon.

It STILL seems to be an issue in 4.26.1 :frowning:

This is still an issue. Any solution?

Ok guys.
Good news.
I’ve taken a look and after an hour we’ve got a workaround.
I’m really salty that Epic leaves such issues unsolved for 5 years, blocking some of us folks for good.

It seems that any FAIMoveRequest requests are using bRequireNavigableEndLocation set to true, and bAllowPartialPath is checked after the path search fails because of EndLocation being out of the navmesh. So the logic is ill-formed.

I don’t give any guarantee for this workaround, do it on your own risk.

  1. Add MyProjectAIController.h and MyProjectAIController.cpp to your project C++ codebase (or use existing AIController class if you have one).
  2. Paste the code from below.
  3. Add “AIModule” to PublicDependencyModuleNames or PrivateDependencyModuleNames in .Build.cs file.
  4. Set MyProjectAIController class as a parent of any blueprint AIController you’re using in the project.

Here’s the code:
MyProjectAIController.h

#pragma once

#include "CoreMinimal.h"

#include "AIController.h"

#include "MyProjectAIController.generated.h"

UCLASS(Blueprintable, meta=(DisplayName="MyProject AI Controller"))
class AMyProjectAIController : public AAIController
{
	GENERATED_BODY()

public:
	/* BEGIN AAIController interface */
	virtual FPathFollowingRequestResult MoveTo(const FAIMoveRequest& MoveRequest, FNavPathSharedPtr* OutPath = nullptr) override;
	/* END AAIController interface */
};

MyProjectAIController.cpp

#include "MyProjectAIController.h"
#include "AITypes.h"
#include "Navigation/PathFollowingComponent.h"

FPathFollowingRequestResult AMyProjectAIController::MoveTo(const FAIMoveRequest& MoveRequest, FNavPathSharedPtr* OutPath)
{
	if (MoveRequest.IsUsingPartialPaths())
	{
		FAIMoveRequest moveRequestFix = MoveRequest;
		moveRequestFix.SetRequireNavigableEndLocation(false); // fix AI not moving when end point is outside of the navmesh.
		return Super::MoveTo(moveRequestFix, OutPath);
	}
	return Super::MoveTo(MoveRequest, OutPath);
}

I did it so the workaround will only work if you set “Allow Partial Path” to true when doing a MoveTo request. I didn’t want to deal with any corner cases which may occur in any other setup.

Set MyProjectAIController as a parent instead of AIController in blueprints:

and here you go:

Give me a like, have a nice day. :slight_smile:

1 Like

@Taberu , you helped me a lot here, thanks!

1 Like

For anyone looking for a blueprint solution:


After writing a C++ workaround, I stumbled upon the node ‘MoveToLocationOrActor’ and it seems that it has a “Require Navigable End Location” option. I haven’t tested if it works but I’m leaving the info here for anyone to try it!

@konstruktor227 Thank you for letting me know! :slight_smile:

1 Like