I have everything working fine on a 2D td game, where enemy sprites use pathfinding to go after characters in the character party when they are in range.
I have the usual components, the Pathfinder for the graphs (grid), then AIPath, plus its modifiers and also AIDestinationSetter, which I’m setting via script for closest target. Collisions in the graph are set to point.
I have a RigidBody2D attached to players and enemies for handling physics and object interaction.
I’m using aiPath.desiredVelocity for setting the sprite’s animation direction on moving and attacking.
But whenever I add a collider2D of any kind to my enemy object, movement is being disabled. I only need it for enemy/player interactions, so that they don’t walk through each other.
I’ve been hunting around and hoping that as I get familiar with A* Pathfinding Project that I’d figure it out. I’ve created a workaround for setting spriteRenderer sorting layers so that although I cannot use collisions to keep some separation between enemy and player character, they at least appear correctly in the space (behind and in front of) relative to their positions when interacting.
But I’d really love to figure out why the Collider2D is disabling the pathdfinding. (I’ve even tried putting the collider on a child object, trying different colliders, but it still disables movement). Any thoughts?