Custom 3D cursor causes game to crash when I move it above the game window in screen space. The following code block handles everything to do with the 3D cursor. How would I allow the cursor to be placed outside of the game window?
func look_at_cursor():
var drop_plane = Plane(Vector3(0, 1, 0), global_transform.origin.y)
var mouse_pos = get_viewport().get_mouse_position()
var from = camera.project_ray_origin(mouse_pos)
var to = from + camera.project_ray_normal(mouse_pos) * 1000
var cursor_pos = drop_plane.intersects_ray(from, to)
cursor.global_transform.origin = cursor_pos + Vector3(0, 1, 0)
look_at(cursor_pos, Vector3.UP)