I’ve implemented a system for a top-down shooter where the crosshairs remain at a fixed distance from the player and move around them in a circular motion towards where they are aiming.
For some reason I’m getting weird behaviour and I cannot for the life of me figure out why it’s happening. When the mouse is aiming in the upper-left quadrant or the lower-right quadrant, everything works fine. The crosshair stays in the position the mouse is aiming.
However, if the mouse is aiming in the upper-right quadrant, the crosshairs will move until they are pointing directly up. If the mouse is aiming in the lower-left quadrant, the crosshairs will move until they are pointing directly to the left.
Basically what I am doing is getting the angle between the player and the mouse position on screen, and using it to calculate the x/y screen coordinates with trigonometry functions at the desired distance. Then using Set Mouse Position to place the crosshairs where they should be.