From 38d108aaa25fa56ac535f1cc655551a802d4e48c Mon Sep 17 00:00:00 2001 From: DualMatrix Date: Fri, 5 Oct 2018 00:09:53 +0200 Subject: [PATCH] Added warning when setting autoplay of AnimationPlayer that's inside the tree. Added warning when setting autoplay of AnimationPlayer that's inside the tree. --- scene/animation/animation_player.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 102f05a14645..ddb89a77d5bf 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1415,6 +1415,8 @@ StringName AnimationPlayer::find_animation(const Ref &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; }