Merge pull request #22739 from DualMatrix/autoplay_warn

Added warning when setting autoplay of AnimationPlayer that's inside the tree.
This commit is contained in:
Rémi Verschelde 2018-12-12 16:10:59 +01:00 committed by GitHub
commit de264a8199
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1427,6 +1427,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;
}