Click To Move

This script moves a GameObject to the cursor position on mouse click or hold.

JavaScript (JS) Version
Author: Sakar

Usage: Simply attach the script to an object you wish to have move towards the mouse. Change the smooth value to alter the speed at which the object moves.

Behavior
If you want the player to move and correct it's path while holding the mouse button, rather than only doing it when clicking, change "GetKeyDown" to "GetKey" on line 10.