Gizmos without MonoBehaviourGizmos

Hello-

The documentation notes that you should inherit from MonoBehaviourGizmos to use ALINE to draw gizmos. If you don’t do this, an error appears in the console telling you such but the drawing happens correctly anyway.

Is there a reason that we need to do this inheritance? I have a common MonoBehaviour subclass with utility methods that I use all throughout the project. I’d prefer not to create a separate base class or add the ALINE code to all of my components.

Is it possible to just disable this error? It seems to render fine.

Thanks!

Hi

With just some extra setup code you can avoid MonoBehaviourGizmos.

Drawing from Unity’s gizmos method sometimes works, but there are a lot of edge cases when it will not work.

Wow, exactly what I was looking for! Thanks for the super quick response. I searched but obviously failed to find this nearly identical topic.

Cheers!

1 Like