How can I check if the mouse is hovering over a 3D object?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Brinux
:warning: Old Version Published before Godot 3 was released.

In a similar fashion to how Button.is_hovered() works, is there some way in the 3D engine to check if the mouse pointer is hovering over a 3D object?

For example, in a 3D scene with 2 testcubes, could I check in my script which (if any) cube my mouse is floating (hovering) over?

This seems like it should be fairly simple, but I can’t find any method for this.

Thanks :slight_smile:

:bust_in_silhouette: Reply From: volzhs

There is a demo for it.

Download demos, and see in demos/3d/mousepick_test