Background
Cool running games involve corners, irregular roads. Find some cool running game case, many are only straight road, there is no so-called path problem, set a direction can, this article mainly gives several I have used, seen in unity can use as a path planning information.
Programme I
Unity comes with a solution navigation, you can refer to Xiao Zhao's article:
Unity comes with pathfinding Navmesh Getting Started tutorial (i)
Unity comes with pathfinding Navmesh Introductory tutorial (ii)
Unity comes with pathfinding Navmesh Getting Started Tutorial (iii)
These articles are still good, with the official documents, the function can be able to do a general connection, of course, more in-depth use of the API to see. Unity's own features are very uncomfortable in the place is the pharmaceutical baking, the operation of dynamic modification is too difficult to achieve precise control is always very awkward.
Programme II
a*pathfinding Project Pro plugin, which is a A * algorithm, to do 2D games, the search for the road depends on this. A * may not be optimal, but it is certainly a relatively stable method, if you are doing a short distance search can try to use, there is a * to get the path often pull over, you see the previous end of the tour, the role of a lot of people are pulled over.
can refer to:
A * pathfinding in the Unity3d
Programme III
using the Curve tool to set the path of the waypoint, and then calculate the position of each displacement point through the curve, the high visibility of the iTween, the plug extension can be processed in unity after all the numerical interpolation problems, said the interpolation, Have to mention two kinds of curve algorithms that are now in contact: Bezier and Curmull-rom, which are interesting to understand. If the same plugin to make the path can be used at the same time Itweenpath, simple animation or can be satisfied, this time to do cool running curve part of the use of this scheme, because the comparison does not come out that better, first use this bar. similar to this plugin and supersplines, and so on.
Summarize
The above is just the route problem, the game will also shoot into the motion of animation, physics and so on, so there is no best, only the most suitable, of course, according to their own needs to achieve the best.
Drizzle marker: Path Category: Games-graphics-
Unity Path Planning