A* AIPath some values are set automatically when they shouldnt?

Been trying to figure out why the AIPath is set automatically when I use a seek node, I've looked through the code and cannot find any reference to it. This value makes the AI wobble a lot since they are changing path every .5 seconds, its also bad for performance:

1631298170524.png

Also wondering why you are calling SetDestination every tick? Surely in OnStart is enough? SetDestination is quite heavy
 
Been trying to figure out why the AIPath is set automatically when I use a seek node, I've looked through the code and cannot find any reference to it. This value makes the AI wobble a lot since they are changing path every .5 seconds, its also bad for performance:
Are you sure that it is the integration setting that variable? I also just searched and didn't see it setting it.

Also wondering why you are calling SetDestination every tick? Surely in OnStart is enough? SetDestination is quite heavy
I thought that I compared the new destination to the previous destination and only set it if it has changed but it doesn't look like I do that with A*, I'll add that in.
 
Are you sure that it is the integration setting that variable? I also just searched and didn't see it setting it.


I thought that I compared the new destination to the previous destination and only set it if it has changed but it doesn't look like I do that with A*, I'll add that in.

Im positive, agent with BD component has that set when first going into a seek node, agent without BD does not get that set when going to a destination using the destination setter component from A*.
 
I am on the latest version of A* and don't even see that as an option within AIPath:

1631517699600.png

The Movement Pack only sets the following properties - maybe A* is changing that value when one of these properties are set?

Code:
            agent.canSearch = true;
            agent.canMove = true;
            agent.destination = target;
 
I am on the latest version of A* and don't even see that as an option within AIPath:

View attachment 7132

The Movement Pack only sets the following properties - maybe A* is changing that value when one of these properties are set?

Code:
            agent.canSearch = true;
            agent.canMove = true;
            agent.destination = target;
Hmm it might be a pro/beta feature, Im on the latest beta branch. Yeah maybe, very odd since it doesnt happen with my own scripts and I call the same code.
 
I've run into the same problem too just recently, with maxSpeed being changed to 10 when I enter Play Mode to test my game, overwriting the value I intended in the Inspector and my NPCs start moving around the scene way too fast. Couldn't find what was the cause of it was but I did come up with a workaround that might help

public class AIPathIntegrationCorrection : MonoBehaviour { [SerializeField] private AIPath aiPath; private float maxSpeed; private void Awake() { if(aiPath == null) aiPath = GetComponent<AIPath>(); if(aiPath != null) maxSpeed = aiPath.maxSpeed; } private void LateUpdate() { if (aiPath != null && maxSpeed != aiPath.maxSpeed) aiPath.maxSpeed = maxSpeed; Destroy(this); // or this.enabled = false } }

I only cached the maxSpeed value and restored it when it got changed but you can easily do the same with all your AIPath properties if needed.
 
After another day of looking at the problem I think I found the problem that I was having, something really simple and dumb I overlooked. In my case the Seek task node I was using had a default speed value of 10 in its inspector and that overwrites maxSpeed in AIPath. Pretty obvious mistake on my part. Still learning everyday.
 
Top