Answers for "godot get mouse position 3d"

2

godot mouse position

get_viewport().get_mouse_position()
Posted by: Guest on April-07-2021
0

godot get mouse position raycast

var mouse_pos = get_viewport().get_mouse_position()
	var from = self.project_ray_origin(mouse_pos)
	var to = from + self.project_ray_normal(mouse_pos) * ray_length
	var space_state = get_world().get_direct_space_state()
	var results =  space_state.intersect_ray(from, to)
	if results.size() > 0:
		return results["position"]
Posted by: Guest on April-14-2020

Python Answers by Framework

Browse Popular Code Answers by Language