How to Make Object Move with Cursor

I am trying to make a game where the object moves with the mouse cursor. The object should be on the cursor and move with it. Also, if I have my object follow the cursor, how can I change the movement? so when the cursor moves left to right, the object should move on the x axis and cursor moves up and down, the object should move on the z axis.

Look at the images for example:

1452621--78620--$rsz_screenshot_2013-12-13_222944.png

You need send more informations about how your game works, but I recommend you look these links:

The game is suppose have the weapon move with the mouse and I need to have the weapon move on the x axis and z axis.

Try this:

using UnityEngine;
using System.Collections;

public class lol : MonoBehaviour {

void Update () {
Vector3 newPos = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y,Mathf.Abs(Camera.main.transform.position.z-transform.position.z)));
newPos.z = transform.position.z;

Cursor.visible = false;
transform.position = newPos;
}

}