Separate drawing for editor and game

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

Hi guys! I have this situation- I’d like to be able to draw one thing when editing my own custom node(made as an editor plugin) and other thing when the game is being run.

Similar thing you can see when editing Path2D- when editing you can see the path and control points, but when you run the game, it’s not visible.

Maybe there’s some good workaround if the feature isn’t implemented yet?

:bust_in_silhouette: Reply From: umfk

You can use get_tree().is_editor_hint() to find out whether you are running in the editor or in the game.

Awesome! Thank you very much!

Ugis Brekis | 2016-02-29 23:16

:bust_in_silhouette: Reply From: BraindeadBZH

For people using Godot 3, you have to replace get_tree().is_editor_hint() by Engine.editor_hint.