Search Unity

[HELP] Only make custom Handles.Slider selectable but not other objects

Discussion in 'Immediate Mode GUI (IMGUI)' started by MCrafterzz, Aug 4, 2019.

  1. MCrafterzz

    MCrafterzz

    Joined:
    Jun 3, 2017
    Posts:
    283
    I'm working on a custom editor tool and want to have a Handles.Slider to change some stuff. The problem is that the slider can't be changed when HandleUtility.nearestControl = GUIUtility.GetControlID(FocusType.Passive); is used. Removing it makes the handle usable but also allows you to select other objects in the scene which breaks the tool totally and doesn't work. So I want my slider to be selectable but nothing else, how do I implement this? I've searched for hours but haven't really found anything. Slider code:
    Handles.Slider(15, position, Vector3.forward, size * 3, Handles.ArrowHandleCap, 1);
    So somehow only things with control id 15 should be selectable. Thanks for any help!