mouse pos ray camera

	var view_pos = get_viewport().get_mouse_position() # 屏幕坐标系的鼠标位置
	var start = camera.project_ray_origin(pos) # 游戏世界的相机原点
	var end = start + camera.project_ray_normal(pos) * 1000 # 游戏世界的相机光线投射到鼠标
	var query = PhysicsRayQueryParameters3D.create(start, end) #4.3版的查询实例
	var result = get_world_3d().get_direct_space_state().intersect_ray(query) # 游戏世界的鼠标坐标

 

https://www.reddit.com/r/godot/comments/1d5col4/question_about_mouse_position/

 

这篇文章好好看,介绍global和local的鼠标位置