Is there a way to get GameObjects (a collection is preferred, altough nearest object and hit point will also do) under the mouse cursor?
There have been similar question already, but all of them were solved by using physical Raycasts or EventSystem’s RaycastAll - but I want to get all the objects, including Lights, objects without any Colliders, non-GUI objects and even empty GO).
The script can work in Editor only, as I’m not going to use it in game.
Most things related to the SceneView is handled by the Handles class and the HandleUtility class. What you’re probably looking for is the HandleUtility.PickGameObject method. Though even this method allow picking of objects without collider, empty gameobjects with no renderer just have no size that could be picked.
Since you haven’t mentioned the actual reason why you want to do this we can’t really suggest any workaround. However pickable controls inside the sceneview are generally added with HandleUtility.AddControl and HandleUtility.nearestControl can be used to determine which control is the closest one.
If you need more help you have to get more specific with your problem.
And just again for reference my IMGUI crash course