AILerp does not reach destination after upgrading A* to 5.4.4 and later

  • A* version: 5.4.4
  • Unity version: 6000.0.59f2

Hi, after updating the package from 5.3.8 to 5.4.4 (and reproduced in 5.4.5 as well), we’ve noticed a strange change in behavior: AILerp no longer reaches the target position, even though it worked reliably before (our project has been in development for years with consistent behavior). We’re using a grid graph.

The issue is difficult to describe because it only occurs at specific target positions and with specific graph sizes. If we move the target position, AILerp reaches it; if we change the graph size, it also works. Our project contains several levels with multiple target points, and after the upgrade we’ve found a few of them have become unreachable.

The Exactness setting is ClosestOnNode, as shown in the attached screenshots. (one is before upgrade, another after)

Any idea please, what could start causing this?

For completes this’d be the primitive call to start affected movement

using Pathfinding;
using UnityEngine;

public class AILerpTest : MonoBehaviour
{
	[SerializeField] private Transform targetPivot;

	private IAstarAI ai;

	private void Awake()
	{
		ai = GetComponent<IAstarAI>();
	}

	private void Start()
	{
		StartMovement(targetPivot.transform.position);
	}

	private void StartMovement(Vector3 targetPosition)
	{
		ai.SetPath(ABPath.Construct(transform.position, targetPosition, null));
	}
}

Mind posting your graph settings? My initial thoughts is that this looks like a float calculation issue. If you’re able, you can send this scene to me as well so I can take a look.

Hello, thank you for taking a look at this. I first wanted to check if there was something obvious I was missing, but I can prepare an empty project where the issue can be reproduced. Would a Scene asset alone be sufficient, or do you prefer a full minimal project?

I’m attaching the current settings that I can provide immediately. Sorry, needed to obfuscate the gist link since I am not allowed to post links as a new user.

—gist.github.com—mavlac/2f8bd6b882f46f75e57023d5e264f347



I was able to reproduce in an empty project, so here would be a Scene asset with settings and simple movement script please:

Yeah I’m not seeing anything out of the ordinary– very straightforward sample project. I did confirm that this exact scene behaves differently on 5.3.8 vs 5.4.5. I’ll let Aron know about this. Thanks for posting :slight_smile:

1 Like

Hi

Thanks. I managed to replicate this, and I think I have a good fix.

It will be included in the next update. Let me know if it works for you.

The issue happened when the target point was right between two nodes.

1 Like

Hello. Many thanks for getting to the root of it. A fix in an upcoming update is very appreciated and I will confirm here after update is available, that it is resolved.

1 Like