# Moving a point next to cursor

**URL:** <https://discourse.threejs.org/t/moving-a-point-next-to-cursor/22877>\
**Category:** Questions\
**Tags:** mouse\
**Created:** [January 27, 2021, 11:36am UTC](https://discourse.threejs.org/t/moving-a-point-next-to-cursor/22877 "2021-01-27T11:36:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aadereiko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/aadereiko/32/15649_2.png) [@aadereiko](https://discourse.threejs.org/u/aadereiko)\
**Post date:** [January 27, 2021, 11:36am UTC](https://discourse.threejs.org/t/moving-a-point-next-to-cursor/22877/1 "2021-01-27T11:36:57Z")

</div>

I want a point to move next to the cursor. The problem is that I have OrbitControls implemented to system. I’ve tried to use:

```
      const vec = new Vector3();
      const pos = new Vector3();
      vec.set(
            (event.clientX / window.innerWidth) * 2 - 1,
            -(event.clientY / window.innerHeight) * 2 + 1,
            -1
          );
      vec.unproject(camera);
      vec.sub(camera.position).normalize();
      const vectorDistance = -camera.position.z / vec.z;
         
      pos.copy(camera.position).add(vec.multiplyScalar(vectorDistance));
      tempPoint.position.set(pos.x, pos.y, pos.z);

```

But there is a problem with **z coordinate** of mouse.
