Hello,
Just started using your A* pathfinding project. I decided to test this plugin by making a game similar to Tanks.(https://store.steampowered.com/app/866420/TANKS/)
Here is how the scene is setup (based it on Example15_2D scene( changed node connections to 4 instead of 8))
Gameplay
The red circle will be controlled by the player using directional keys.So for example if player presses right arrow, the circle will continue to move right till it hits a wall or player pressed left arrow. Circle will only move on path made using connections between the nodes.
Problem
Here is the gameplay recording.
As you can see when player hits left arrow, Circle starts moving left in straight line but the when pressed up arrow, the generated path is not straight causing circle to behind the wall tiles.
I am using provided Seeker and AI Path scripts to move the circle. and following lines to create new path when input is received.
GraphHitInfo hitInfo = new GraphHitInfo();
if (gridGraph.Linecast(transform.position, transform.position + (Vector3.right * 25), null, out hitInfo)) {
seeker.StartPath(ABPath.Construct(transform.position,(Vector3)hitInfo.node.position, OnPathEvent));
}
Looking forward to hearing from you.
Thanks