Loading Animations from mixamo

Hi, I’m having problems loading my mixamo animations (with C# script)
Whatever I seem to try, I get the error “There is no ‘Animation’ attached to the “Animation@idle_1” game object, but a script is trying to access it.”

My animation was downloaded from mixamo as Skeleton Only, in Unity fbx format.

GameObject x = Resources.Load("_Animations/Animation@idle_1") as GameObject;
if(!x) Debug.Log("didnt load");
AnimationClip ac = x.animation["idle_1"].animation.clip;

I’ve tried using animation.clip, animation[< name >].clip, but it always gives the same error in the 3rd line.

1 Answer

1

It’s name may still be Animation@idle_1 but you can get it by doing:

  var ac = x.animation.clip;

Thanks whydoidoit, but I've tried that and I sill get the same error. My code was C# AnimationClip y = x.animation.clip; I just can't see where the problem is. (I should add that I've tried 3 different animations downloaded from mixamo - and all give the same error).