- Home /
How to Avoid Corner paths in A* pathfinding
Hi I am trying to make a race game, I am using A* pathfinding of arongranberg, My characters able to move from source to destination, but the problem here is Above Pathfinding algorithm finding the shortest path, so it finds the path near the corners of the race Track. When the character try to move in that path it fell down. How to make a smooth path from source to destination even though it is long, i.e it should avoid corners.
Answer by Pragnani K · Jul 20, 2013 at 09:24 AM
// By default, a search for the closest walkable nodes to the start and end nodes will be carried out //but for example in a turn based game, you might not want it to search for the closest walkable node, but return an error if the target point //was at an unwalkable node. Setting the NNConstraint to None will disable the nearest walkable node search
p.nnConstraint = NNConstraint.None;
Your answer
![](https://koobas.hobune.stream/wayback/20220613110501im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
how to get in game numerical input 1 Answer
only detect numerical keyboard input 2 Answers
Distribute terrain in zones 3 Answers