Locate my mouse in 3D space?

I want to make a 2D control game (in 3D space)
how do I locate my mouse in 3D space?
then I can make my player aim the position.
anyone help me?

Do something like this on an empty GameObject that you will use as you “AimTarget”, then have the player’s gun LookAt() it:

public var player : Transform; // drag your player object here, or find it in Start()

function Update(){
	var playerDistanceFromCam : float = Vector3.Distance(Camera.main.transform.position, player.transform.position);
	transform.position = Camera.main.ScreenToWorldPoint(Vector3(Input.mousePosition.x, Input.mousePosition.y, playerDistanceFromCam));
}

Thank you very much , Quietus
I did it. :smile:

legend , Thank you too, I will try that ,too!