A* Pathfinding ProjectThis pathfinding system was created to provide an out-of-the-box pathfinding solution for Unity 3D, a free version exists of course.
5 comments
Hopeful says:
Hi Aron, first off, thank you for releasing your pathfinding script for free – it is a very valuable asset in anyone’s arsenal.
I wanted to ask if this would work on multiple sides of a cube. All of the Dynamic Nav I’ve tried won’t work for example, on the side of a object/mesh.
Any response is appreciated!
Michael Lowe says:
I had the same thought about how to make this work for 3D angles. There is a way to get a floated value of where an object is looking, and where the second object is in view. I believe this function I wrote a long time ago makes it so that if the current object is looking directly at obj, the function returns 0, and if it is looking directly away from obj, it returns 180, so the function returns a number between 0 and 180 depending on where obj is in view IF the current object were to be a camera.
function getViewAngle(obj : GameObject) : float {
var ang : float;
var forward = transform.forward;
var targetDir = obj.transform.position – transform.position;
ang = Vector3.Angle(targetDir, forward);
return ang;
}
Michael Lowe says:
One idea I might have is in the NavGraph::Scan() function, we could add a new feature that will make all the nodes connect only if each connecting node is within a certain angle range of the connector node (making a one-way pathfinding system on certain graphs). The problem I have is that I can not locate the NavGraph class and its functions anywhere.
Will this will work for 3 dimensions for an air plane chase/avoid scenario? Or can it be easily modified to do so? Feel free to contact me at email provided. Thanks!
Hi Aron, first off, thank you for releasing your pathfinding script for free – it is a very valuable asset in anyone’s arsenal.
I wanted to ask if this would work on multiple sides of a cube. All of the Dynamic Nav I’ve tried won’t work for example, on the side of a object/mesh.
Any response is appreciated!
I had the same thought about how to make this work for 3D angles. There is a way to get a floated value of where an object is looking, and where the second object is in view. I believe this function I wrote a long time ago makes it so that if the current object is looking directly at obj, the function returns 0, and if it is looking directly away from obj, it returns 180, so the function returns a number between 0 and 180 depending on where obj is in view IF the current object were to be a camera.
function getViewAngle(obj : GameObject) : float {
var ang : float;
var forward = transform.forward;
var targetDir = obj.transform.position – transform.position;
ang = Vector3.Angle(targetDir, forward);
return ang;
}
One idea I might have is in the NavGraph::Scan() function, we could add a new feature that will make all the nodes connect only if each connecting node is within a certain angle range of the connector node (making a one-way pathfinding system on certain graphs). The problem I have is that I can not locate the NavGraph class and its functions anywhere.
Will this will work for 3 dimensions for an air plane chase/avoid scenario? Or can it be easily modified to do so? Feel free to contact me at email provided. Thanks!
i’m looking for the same thing!