Figure: Diagnostic workflow: Editor drawing → Scene/Game gizmo toggles → Separate runtime visuals
Figure: Diagnostic workflow: Editor drawing → Scene/Game gizmo toggles → Separate runtime visuals

Cause and mechanism

Gizmos can display camera-view outlines and range markers in the Scene view. Gizmos is a UnityEngine API; Handles, for interactive editing controls, belongs to UnityEditor. Treat Editor-only visualization separately from shapes that need to render inside a built game.

Check and correct the setup

  1. Find UnityEditor, Handles, and EditorUtility references in build errors. Isolate editor code or guard both imports and calls with UNITY_EDITOR.
    Follow input, processing / condition, then output
    Follow input, processing / condition, then output
  2. Enable Game view Gizmos in the editor and check the callbacks and selection conditions.
    Follow input, processing / condition, then output
    Follow input, processing / condition, then output
  3. For player-visible lines use LineRenderer, meshes, or a supported render pass. Debug.DrawLine is not a player UI solution.
    Follow input, processing / condition, then output
    Follow input, processing / condition, then output

Limits and verification

Verify editor and player visibility separately. Do not move a needed runtime component entirely into an Editor folder.

A focused diagnostic setup

Show a small camera-position/direction gizmo in Scene and Game views. This checks visibility rather than compiler errors.

Test in this order

  1. Check each view toggle and component visibility.
    Follow input, processing / condition, then output
    Follow input, processing / condition, then output
  2. Compare selected/unselected callbacks, position, size and clipping.
    Follow input, processing / condition, then output
    Follow input, processing / condition, then output
  3. Replace required Player visuals with runtime geometry such as LineRenderer and verify separately.
    Follow input, processing / condition, then output
    Follow input, processing / condition, then output

Interpret the result

Scene-only visibility suggests view settings; selection-only visibility suggests callback choice. Editor gizmos do not validate Player rendering. Runtime visuals need their own interaction and cost checks.

Related explanations

References