Can't get A* Search from Movement Pack working

MattShirley

New member
Hello! I've been playing around with Behavior Designer. Great asset overall, but I haven't been able to get the A* Search component working. The demo scene works as expected. My scene setup is similar to the demo scene, except using 2D features. I also previously used a different behavior system and it worked fine, so hopefully there's nothing major wrong here.
  • Unity 6 Preview (but same behavior experienced using 2022.3 LTS).
  • Behavior Designer v. 1.7.10
  • Movement Pack v1.6.1
  • A* Pathfinding v4.2.17
This line (18 of MovementUtility.cs) seems to be where something isn't working properly. My hitCount is always 0. I don't know much about Unity's physics engine, so I'm not sure how to continue debugging.
var hitCount = Physics.OverlapSphereNonAlloc(transform.TransformPoint(positionOffset), viewDistance, overlapColliders, objectLayerMask, QueryTriggerInteraction.Ignore);

This is my Behavior Tree. The object layer mask is set to everything. I've also tried playing with the offsets as mentioned in the documentation. The rest of the tree works fine if I disable the Search node and manually set the target myself.
Screenshot 2024-08-04 at 2.27.17 PM.png
And here's my A* grid for reference.

Screenshot 2024-08-04 at 2.31.19 PM.png
 
If use2DMovement is enabled you shouldn't get to Physics.OverlapSphereNonAlloc since that is for 3D. What is the callstack of that function call? Are you using the A* version of the Search task? The A* version of search doesn't have the 2D parameter so my guess is that you are using the NavMesh version.
 
If use2DMovement is enabled you shouldn't get to Physics.OverlapSphereNonAlloc since that is for 3D. What is the callstack of that function call? Are you using the A* version of the Search task? The A* version of search doesn't have the 2D parameter so my guess is that you are using the NavMesh version.
Thanks for your response. I will dig into this further after work. I can confirm that it is the A* star version of Search. The IAstarAIMovement class does include a use2DMovement attribute, but it doesn't look like it's used anywhere. (I just reimported the A* plugin to confirm this is correct.)

Screenshot 2024-08-05 at 9.24.20 AM.png
 
Last edited:
It looks like you're right - the Search task of A* doesn't use that parameter at all. I'll do an update to the A* integration which adds support for it - it'll be really similar to the NavMesh version of search where a different method is called if you are using it in a 2D environment.

Edit: Just added it - go ahead and download the A* integration again.
 
Last edited:
It looks like you're right - the Search task of A* doesn't use that parameter at all. I'll do an update to the A* integration which adds support for it - it'll be really similar to the NavMesh version of search where a different method is called if you are using it in a 2D environment.

Edit: Just added it - go ahead and download the A* integration again.
Thank you so much for the quick turn around time! I just dropped the new version in, and it appears to be working. Very excited to work with this asset now.
 
Back
Top