Unity - Scripting API: HandleUtility.PickAllObjects
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Declaration
public static void PickAllObjects(Vector2 position, List<Object> results);
Parameters
| Parameter | Description |
|---|---|
| position | The position in screen coordinates. The top-left of the window is (0,0), and the bottom-right is (Screen.width, Screen.height). |
| results | The output list to populate with all GameObjects at the specified position. |
Description
Creates a list of all GameObjects under the specified position in screen coordinates.
HandleUtility.PickAllObjects must not be called during a repaint. In most cases, it is appropriate to call during EventType.MouseDown or EventType.MouseUp. A common use would be to pick all GameObjects at the current cursor position.