Converting 2D position in a viewport frame to a ray

I was unaware I could do that, thanks for telling me, it makes the raycasting slightly easier, but it still doesn’t solve my issue. The issue isn’t that the raycasting doesn’t work, because it does, the issue is that the ray that i’m using is facing in the wrong direction.