How to draw gizmos in godot editor?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Twk Amz
:warning: Old Version Published before Godot 3 was released.

Hi, I’m trying to make a simple game in godot using tilemaps and pathfinding. The thing is, I have a tilemap with very similar tiles that only differ in the navigation polygons they have. So I have no way to tell them apart once I start making a level(because the navigation polygon is not visible outside the tile map scene).
I wanted to know if there’s some equivalent of unity’s onDrawGizmos() to draw the navigation polygons in the editor so it’s easier for me to edit the map.


:bust_in_silhouette: Reply From: Twk Amz

Never mind, I solved it by adding collisionshapes to non-walkable tiles instead of modifying the navigation polygon(would be cool if there was a way to draw gizmos anyway)

For anyone coming from google: There is indeed way to draw in editor, you need to use tool mode. Short: just add tool keyword to top of your script, now your script will be always executed inside editor. Google godot tool mode for more info.

SkaceKachna | 2016-08-16 20:31