How to create a Path

Hey guys I need some Help here. How to create a path for example to make a path in form of an 8 and when I am moving my character it will go only on this path.

I don’t want it to move automatic or to follow it, I just need to it make when I press D it will on this path and when I press A will move opposite direction.

My thought is to make an array of points, where this points will be the path but I don’t know how to implement it, that’s why I’m looking for your help.

The easiest solution is to use iTween (free in the AssetStore). If you want to roll your own, search UA for ‘waypoint’ answers or ‘spline’ answers. Code for both has been published many times.

Note iTween has a free path editor:

http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/

You can use iTween’s built in functions to move along the path or you can use iTween.PutOnPath() and/or iTween.PointOnPath() and manage the movement in your own code.