I've been looking through the documentation and can't seem to find anything for dealing with 3D mouse position. Any help on info for this would be great.
Here some edit code I use in C# (it has been edit here so it may syntax errors but the idea works)
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Input.GetMouseButtonDown(0)) {
if (Physics.Raycast(ray , out hit , 100F)) {
hit.collider.SendMessage("OnMouseDown" , SendMessageOptions.DontRequireReceiver);
}
}
it converts the mousePosition to ray cast from the camera position. then chacks what colliders that ray hit. So you will need colliders on your 3D object. and then sends a message to the object.
http://unity3d.com/support/documentation/ScriptReference/Camera.ScreenToWorldPoint.html
If you feed the screen position of the mouse and a z-distance into the above function, it will return a coordinate in world space.
There are numerous examples of using it you can find on the forums. Everything from click-walking for an RTS to controlling 3d cursors.