소스 검색

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

Added warning when setting autoplay of AnimationPlayer that's inside the tree.
DualMatrix 7 년 전
부모
커밋
38d108aaa2
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      scene/animation/animation_player.cpp

+ 2 - 0
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;
 }