Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Aaron | |
Old Version | Published before Godot 3 was released. |
I have an object (set to tool mode) with some variables that I want to depend on where it’s positioned in the scene editor. These variables don’t depend on where the object is positioned in general - especially when I animate the object’s position during gameplay. Just when the object is dragged around in the scene editor.
I tried overriding _notification
and checking for NOTIFICATION_TRANSFORM_CHANGED
, but this seems to happen for whenever anything changes the object’s position, whether it’s the editor or anything else. Using get_tree().is_editor_hint()
seems to give a nil error inside _notification
.
get_tree
is only usable after _ready
, so it might not be available during NOTIFICATION_READY
. Maybe you should check for is_editor_hint
only after you are sure it is NOTIFICATION_TRANSFORM_CHANGED
? Also, try doing get_tree() != null
too.
Bojidar Marinov | 2016-03-14 16:16