1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Added warning when setting autoplay of AnimationPlayer that's inside the tree.

Added warning when setting autoplay of AnimationPlayer that's inside the tree.
This commit is contained in:
DualMatrix
2018-10-05 00:09:53 +02:00
parent 8068d0217a
commit 38d108aaa2

View File

@@ -1415,6 +1415,8 @@ StringName AnimationPlayer::find_animation(const Ref<Animation> &p_animation) co
} }
void AnimationPlayer::set_autoplay(const String &p_name) { 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; autoplay = p_name;
} }