Move Towards MousePosition

Hey folks, here i have a code that is going to move the object its attatched to to my mouse position. But when ever i click it just goes up in the sky (the y axis), and i just want it to move in the Z,X axis. please help!


using UnityEngine;
using System.Collections;

public class GotoMouse : MonoBehaviour {
	public float speed = 1.5f;
	private Vector3 target;
	void Start () {
		target = transform.position;
	void Update () {
		if (Input.GetMouseButtonDown(0)) {
			target = Camera.main.ScreenToWorldPoint(Input.mousePosition);
			target.x = transform.position.x;
		transform.position = Vector3.MoveTowards(transform.position, target, speed * Time.deltaTime);

You need to pass Transform position.y of the object to the target.position.y

target = new Vector3(target.x,transform.position.y,target.z);


target = new vector3(target.x,transform.position.x,target.z);