The animation of the selected character is not loaded

Hello, I’m new to Unity and I’m trying to make a game.
However, I am unable to progress further in loading 2D skeleton animation into 2D object. Could you please look at the parts of my code that play the animation and the inspector settings to see what the problem is?

I’m making this game for me and my friends, but if you help me I’ll put your name in the ending credits. (Sorry, I would like to reward you with the amount if possible, but since I am a minor, I do not have an overseas payment card;( )

[Header(“Player Animators”)]
public Animator playerAnimators; // 각 플레이어 캐릭터의 Animator

private RuntimeAnimatorController CreateRuntimeAnimatorController(CharacterData character)
{
AnimatorOverrideController animatorOverride = new AnimatorOverrideController();
animatorOverride.runtimeAnimatorController = Resources.Load(“BaseAnimatorController”);

animatorOverride["Idle"] = character.idleAnimation;
animatorOverride["Skill1"] = character.skill1Animation;
animatorOverride["Skill2"] = character.skill2Animation;
animatorOverride["Skill3"] = character.skill3Animation;

return animatorOverride;

}

private RuntimeAnimatorController CreateOverrideAnimator(CharacterData character)
{
AnimatorOverrideController overrideController = new AnimatorOverrideController();
overrideController.runtimeAnimatorController = Resources.Load(“BaseAnimatorController”);

overrideController["Idle"] = character.idleAnimation;
overrideController["Skill1"] = character.skill1Animation;
overrideController["Skill2"] = character.skill2Animation;
overrideController["Skill3"] = character.skill3Animation;

return overrideController;

}

private bool HasAnimation(Animator animator, string animationName)
{
foreach (AnimationClip clip in animator.runtimeAnimatorController.animationClips)
{
if (clip.name == animationName)
{
return true;
}
}
return false;
}

private IEnumerator ResetToIdle(Animator animator, int characterIndex)
{
yield return new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length);

if (animator.GetCurrentAnimatorStateInfo(0).IsName("Idle"))
{
    yield break; // 이미 Idle 상태라면 종료
}

animator.Play("Idle"); // Idle 애니메이션으로 복귀

}

private void SetupPlayerAnimators()
{
for (int i = 0; i < playerObjects.Length; i++)
{
if (i < playerCharacters.Count && playerCharacters[i] != null)
{
Animator animator = playerObjects[i].GetComponent();
if (animator == null)
{
animator = playerObjects[i].AddComponent();
}

        animator.runtimeAnimatorController = CreateOverrideAnimator(playerCharacters[i]);
    }
}

}


Character Data

[Header("Character Animations")]
public AnimationClip idleAnimation;
public AnimationClip skill1Animation;
public AnimationClip skill2Animation;
public AnimationClip skill3Animation;

I selected a 2D object as the game object I wanted to load the current character into, added a sprite renderer and an animator, and then inserted the animator override controller into the animator’s controller. Also, I added the 2D object mentioned earlier to the player animator of the main system, and also added a 2D object to the player object.