Raytrace Ignore the x axis ?

Hi everyone,
I’m trying to make my character moving by clicking, but the software doesn’t take my X axis informations…

        if((Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) || (Input.GetMouseButtonDown(0)))
        //Verifie si l'écran est touché, cliqué.
         {
              //Declare une variable de type definition de projection 3D
            RaycastHit hit;
            //Cherche la Localisation d'aprés une projection 3D de l'écran
            Ray ray;
             //for unity editor
            #if UNITY_EDITOR
            ray = Camera.main.ScreenPointToRay(Input.mousePosition);
             //for touch device
            #elif (UNITY_ANDROID || UNITY_IPHONE || UNITY_WP8)
            ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
            #endif
            //Regarde si il ne touche rien
              if(Physics.Raycast(ray,out hit))
             {
              //Definie un drapeau
             Drapeau = true;
              //Sauvegarde La Position du click
             PointDArrivee = hit.point;
             PointDArrivee.y = yAxis;
             PointDArrivee.x = xAxis;
             Debug.Log(PointDArrivee);
   }
         }
            //Regarde ou on as cliquer, et verifie si on est bien dans une autre position
            if(Drapeau && !Mathf.Approximately(Joueur.transform.position.magnitude, PointDArrivee.magnitude)){ //T'occupe xD
             //Bouge le joueur
              Joueur.transform.position = Vector3.Lerp(Joueur.transform.position, PointDArrivee, 1/(Vitesse*(Vector3.Distance(Joueur.transform.position, PointDArrivee))));
             }
             //set the movement indicator Drapeau to false if the PointDArrivee and current gameobject position are equal
            else if(Drapeau && Mathf.Approximately(Joueur.transform.position.magnitude, PointDArrivee.magnitude)) {
            Drapeau = false;
            Debug.Log("Je suis arrivé a distination.");
  }

do you have idea to arrange that ?
thank you

PointDArrivee = hit.point;
PointDArrivee.y = yAxis;
PointDArrivee.x = xAxis;
//...
player.transform.position = Vector3.Lerp(player.transform.position, PointDArrivee, //..amount..//)

so you’re only taking the z component into account from the click? in 3d thats the vertical axis, in 2d it’s into/outof the screen… having trouble visualising how that is suppose to work?

First, thank you !
Yeah, I have a lot of problem with Raytracing…
I don’t know why it select some infos or not…
I mean, it’s a vector3 thing, wish mean it take the 3D positions no ?
I kind of understand that in 2D, to 3D, the axis may change… but that’s all

I understand now, I fixed it by placing

if(Physics.Raycast(ray,out hit))
                        {
                           
                            Drapeau = true;
                            PointDArrivee = hit.point;
                //this :
     yAxis = Joueur.transform.position.y;
                            PointDArrivee.y = yAxis;
                            Debug.Log(PointDArrivee);