diff options
author | DualMatrix <piet.goris@gmail.com> | 2018-10-05 00:09:53 +0200 |
---|---|---|
committer | DualMatrix <piet.goris@gmail.com> | 2018-10-05 00:09:53 +0200 |
commit | 38d108aaa25fa56ac535f1cc655551a802d4e48c (patch) | |
tree | 5dd323f5f984136c50360ce4bd65e3e707e6c20d | |
parent | 8068d0217a5e74c25f83fe93fa6e077b8d0b3bf5 (diff) |
Added warning when setting autoplay of AnimationPlayer that's inside the tree.
Added warning when setting autoplay of AnimationPlayer that's inside the tree.
-rw-r--r-- | scene/animation/animation_player.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 102f05a146..ddb89a77d5 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1415,6 +1415,8 @@ StringName AnimationPlayer::find_animation(const Ref<Animation> &p_animation) co } void AnimationPlayer::set_autoplay(const String &p_name) { + if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint()) + WARN_PRINT("Setting autoplay after the node has been added to the scene has no effect."); autoplay = p_name; } |