Only Teleports Player Every Once in While

Snippet of Teleport.cs where it isn’t working:

Vector3 point = new Vector3(hitxz.point.x, hity.point.y, hitxz.point.z);
if (teleport_example == null) {
     teleport_example = Instantiate(teleport_example_prefab, point, new Quaternion(0, 0, 0, 0));
} else {
     teleport_example.transform.position = point;
}
    
if (Input.GetMouseButtonDown(0)) {
     transform.position = point;
     Debug.Log("SDFSDF");
}

The weird problem when this code runs is that 'teleport_example.transform.position = point;` works just fine, but when I click the left mouse button, ‘transform.position = point;’ only works every 3 - 30 times. Also, the console shows “SDFSDF” being printed, but the player isn’t being teleported! I tried checking to see if gameObject was null for some odd reason, and it’s not.

Teleport.cs is a component of player, and the code is being run in Update()

Please tell me if you need any more information, and thanks in advance.

Hello,
can you share hitxz.point when being set?
you can check with Debug the player pos and point pos in button to check properly, like this:

if (Input.GetMouseButtonDown(0)) {
      Debug.Log("check MouseDown, transform.position :"+transform.position .x+", "+ transform.position.y+", "transform.position.z);
      Debug.Log("check MouseDown, pos of point:"+point.x+", "+ point.y+", "pointz);
      transform.position = point;
      Debug.Log("SDFSDF");
}

If it on wrong pos, then you can check it’s point get set properly or not.

I found the solution! It actually was the CharacterController script for some odd reason. The fix was to disable to CharacterController script before I changed transform.position then re-enable it afterwards.

Here is the final portion:

point = new Vector3(hitxz.point.x, hity.point.y, hitxz.point.z);
                    if (teleport_example == null) {
                        teleport_example = Instantiate(teleport_example_prefab, point, new Quaternion(0, 0, 0, 0));
                    } else {
                        controller.enabled = false;
                        teleport_example.transform.position = point;
                        controller.enabled = true;
                    }

                    if (Input.GetMouseButtonDown(0)) {
                        point.y += 1;
                        transform.position = point;
                    }

Thank you to @GeroNL for helping me find the solution.