Search Unity

HandleUtility.PickRectObjects() error

Discussion in 'Scripting' started by FeastSC2, Jun 19, 2019.

  1. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I'm having trouble using the HandleUtility.PickRectObject function of Unity in (https://docs.unity3d.com/2017.2/Documentation/ScriptReference/HandleUtility.PickRectObjects.html)

    Whenever I call this in an editor script, I get a nullreference error message. Yet I'm certain that I'm not giving it anything that's not initialized.
    NullReferenceException: Object reference not set to an instance of an object.

    My goal is to create a hotkey that selects all the gameobjects that overlap each other in the SceneView.
    Can I get an example of how to properly use HandleUtlity.PickRectObject?
     
    Last edited: Jun 19, 2019