I'm struggling to figure out how to measure the distance in between 2 points (the first on a layer with 100%x100% parallax, the second on a layer with 0%x0% parallax).
The second point represents the gamepad's crosshair for my game, while the first one represents the gun (for setting the width of lasers, scopes and such).
Obviously, simply setting the width to distance(point1x,point1y,point2x,point2y) doesn't works
Already tried several ways, including making a function that returns numbers; with equations including scrollx and scrolly (and dividing both positions by the viewport's height/width) - came kinda close to it, but couldn't find why it doesn't works sometimes.
Help would be greatly appreciated