I'm trying to raycast from center of screen as far as possible, tried this but it barely goes any distance and seems to be firing at the top of the screen instead of the center:
var from = cam.project_ray_origin(Vector2(0.5,0.5))
var to = from + cam.project_ray_normal(Vector2(0.5,0.5)) * 10000
var space_state = get_world().direct_space_state
var result = space_state.intersect_ray(from, to, [ self , player], 2147483647, true, true )
and
var to = from + cam.project_ray_normal(Vector2(0.5,0.5)) * -INF
doesn't work for some reason.