Handling mouse inputs to create a 2D crosshair / targeting position

In my 2D game (3D graphics / world) I want to have a “aim position” that is a point in the 3D(although zPos should be 0) world that has a default start position and moves according to how the user moves his mouse. I would use cam.getWorldPosition, however I run into these problems:

the start position would not matter and you would not have to “move from it” as it would be instantly locked to the mouses position.

in the future I might have the camera move around (with the game plane staying the same) causing the motions to vary in effectiveness (i assume).

Is there a way to just capture the direction of the mouse moving and relate the speed to world cooridinates? Maybe I should just normalize the mouse movement on the srceens xy plane and then apply a “sensitivity” to get the new world coordinate?

Hi, I actually did not quite understand your problem, but for this

you could do the following:

  • Capture the mouse position at one point in time
  • Capure it again and compare the X/Y coordinates and depending on the difference you can find out the direction and magnitude if I am not mistaken

Speed = time / distance. You need 2 points of reference and tpf.

Sorry if it was not clear!

Yea I was thinking something similar which originally I did not think would work but now It does (what I was trying to explain with changing the camera angle). Thanks!