Godot - Get mouse position
GDScript code examples to get mouse position.
Mouse position in viewport display can be obtained with get_mouse_position()
.
var mouse_position = get_viewport().get_mouse_position()
Mouse position in global display can be obtained with get_global_mouse_position()
.
var mouse_position = get_global_mouse_position()