Draw to follow

I want to make a game like this:
http://www.youtube.com/watch?v=dkp9pxYts_w&feature=player_embedded
How to draw path for an object to follow?
Can give me some tutorial or suggest,please! thanks!!

Just like @rutter has layed out. Here is my first answer and script :

http://answers.unity3d.com/questions/231349/object-follow-the-mouse-path.html

Edit : While it is not encouraged to write full scripts for people on this 'site, I have made a guide for this, following the steps I took to make this. Just keep in mind that I am a noob, this is just to help out other noobs :slight_smile:

Make a Simple AirCraft Controller Game in Unity

Here is the link for the player following after mouse has been dragged script :

http://www.alucardj.net16.net/unityanswers/ScriptFollowAfterDrag.js

@Bunny83 - Thankyou for the thought and comment =]

Break a big problem into smaller problems:

  • Map finger touches to points in world space
  • Create a “path” structure, which tracks those points
  • Create objects that can follow the path
  • Create objects that can draw the path

Mapping touch to location is one of the most common questions on this board.

At the very least, you’ll want to track the touch positions with some kind of list. You may want to run some sort of smoothing on user input, but that can get rather complicated.

There are many ways to follow a path. The simplest is probably Vector3.Lerp() or something similar.

For drawing paths, you’ll want a line renderer or something similar.