OnDrawGizmos never called

hi,

planning on adding some procedural / interactive editor tools to generate GOs in C#

Unfortunately the

OnDrawGizmos() { … }

get’s never called

any suggestions ?

Win7 64bit, latest U5.3 fresh install

Possibly checked already, but: Unity - Scripting API: MonoBehaviour.OnDrawGizmos()

Collapsing the component in the inspector stops the Gizmo from running.

Show code?

1 Like

it actually works if I attach the script to a GameObject

but I want to draw gizmos while in Editor (no GO) selected and to be able to visually ‘define’ some parameters before a GO is added to the scene

the gizmos show a sketch of the object to be created

http://CyG-DATA.info/code/Unity/MultiPrism.php…

using System;
using System.Collections;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif

public class GSGizmos : MonoBehaviour {
void OnDrawGizmos() {
//Debug.Log(“hello”);
Gizmos.color = Color.yellow;
Gizmos.DrawSphere(new Vector3(0,0,0), 1f);

}
}