help me:(
i want my character to shoot at the mouse cursor
var playerNormalBullet:GameObject;
var target:MouseCursor;
var speed:int;
function Update ()
{
if(Input.GetKey(KeyCode.Mouse0))
{
var currentBullet :GameObject = Instantiate(playerNormalBullet,gameObject.transform.position,
gameObject.transform.rotation);
currentBullet.transform.position = Vector3.MoveTowards
(currentBullet.transform.position,target.transform.position,300);
}
}
its not completed yet but when i tested it i get this error ‘transform’ is not a member of ‘unityeditor.mousecursor’
i think ive done it wrong … anyone pls help me 
thx a lot
var target:MouseCursor;
It was worth keeping your fingers crossed that might work :), but unfortunately you cannot use MouseCursor that way. If you look it up in the Scripting Reference you will see it is an editor class enumerator to indicate the type of cursor icon to display.
What you might do is use ScreenToWorldPoint and have the object that does the shooting aim at the world point that is at the near clip plane of the camera that is under the mouse cursor (untested example here: )
var target : Vector3 = camera.main.ScreenToWorldPoint (Vector3 (Input.mousePosition.x, Input.mousePosition.y, camera.nearClipPlane));
Also, the logic in the script is saying to instantiate a new bullet continuously while the left mouse button is down, and it does the MoveTowards ONCE for that bullet. This is then repeated for every bullet (and that would be a lot of bullets!)
You need to move the code that translates the bullet somewhere else. What is often done is the translation of the bullet would be a different script on the bullet. The challenge to do it in this single script is you have to keep the name of every new bullet and not just the one most recently instantiated.
thank you for good explanation 