How do you make handles show even if the GameObject is not selected?

As per the title, I want to see all the handles on a prefab in the scene without having it selected. Currently it only shows if I have selected it which is super annoying as I want some text labels in the editor window whilst I am debugging.

How do you do this ?

I usually just use OnDrawGizmos for important bits of my prefabs, but I think what you want actually might be possible.

I base this “think” on the BezierSolutions package in the asset store. It’s free and it implements a OnSceneGUI() that draws several handles at once on a given object. It might still require at least one GameObject be selected but I haven’t fiddled with it much.

I see it being done in their BezierPointEditor.cs editor script.

You can’t draw handle labels in the gizmo’s so i can’t get text labels from that.

And yeah that still requires selecting the game object for the bezier stuff.

Attach this kind of script to your gameobject. Note the ExecuteAlways attribute which should make this work in edit mode as soon as the object is enabled regardless if it’s selected or not. If you want to add this into a script that also handles play mode logic you can check Application.isPlaying in the code.

using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif

[ExecuteAlways]
public class HandlesBehaviour : MonoBehaviour
{
#if UNITY_EDITOR
    private void OnEnable()
    {
        SceneView.duringSceneGui += OnSceneGUI;
    }

    private void OnDisable()
    {
        SceneView.duringSceneGui -= OnSceneGUI;
    }

    private void OnSceneGUI(SceneView sceneView)
    {
        // Draw your handles here
    }
#endif
}

Have you tried? You might find that you actually can.