Breadcrumb Trail

This might be easy but i cant figure out how to instantiate Gameobjects on the Path like a Breadcrumb Trail. Dose anybody have an idea how i can access coordinates along the path? Moreover i would like to know how i can find just the corner points on my grid graph path(4 connections, no cut corners) because they should be marked by another type of game object. Sorry if this is a stupid question but i just don’t know where to start.

I found a solution for the breadcrumb:

public void OnPathComplete (Path p) {
	Debug.Log ("Yey, we got a path back. Did it have an error? "+p.error);
	List<Vector3> path = p.vectorPath;

	for (int i=0;i<path.Count;i++) {

Dose somebody know how i can find just the corner points of the path?


The “corner” points are not specified in any direct way, but you can use the angle to see if it looks like a corner.

for ( int i = 0; i < path.Count; i++ ) { if ( i == 0 || i == path.Count-1 || Vector3.Angle(path[i-1]-path[i], path[i+1]-path[i])) < 120 ) { // Instantiate }

The above code will place a breadcrumb on every point which has an angle smaller than 120° (a straight line would have an angle of 180°).