Hi guys.
So I am new to Unity, I was reading a lot of answers but non helped me.
I am struggling with this for 4 days now.
I imported the following animations from the asset store: Raw Mocap Data for Mecanim Unity Asset Store - The Best Assets for Game Making
And when I attach any of the animations to my character I get the following message:
Animation component 'Flash' must be marked as Legacy.
I triend the following
- Set animation and my character to legacy from Inspector / Rig / Animation type legacy, but this way the animation is not playing, but no messages
- Tried to mark animation as legacy form inspector, I clicked the clip selected Debug mode, tried to check the legacy checkbox, but it’s grayed out.
- Duplicated the animation, again tried to mark animation as legacy form inspector, I clicked the clip selected Debug mode, tried to check the legacy checkbox, but it’s still grayed out.
Could please any of you can give me a hint?
I am using Unity 5…3.4f1
Thank you
I loaded the free Raw mocap data and got it to work with this list of steps
1.) Download project
2.) Create a plane (for avatar to stand on) and drag in default avatar.
3.) Make sure avatar rig is set to humanoid
4.) Create animator controller in animations folder (or wherever you like to keep it.)
5.) Apply the animator controller to avatar.
6.) Open animator controller and drag desired idle animation into it. Then drag in desired run animation. Click on animation reference, create a new animation called run and crop so it will loop. I used JogForward_NtrlFaceFwd.fbx. I cropped the time from frame 56 to 78 for loop.
7.) Add a character controller and attach it to avatar.
8.) Create animator controller script (see example below) and apply it to avatar.
This process will avoid legacy all together and the animations will work and you wont ever have to redo anything when Unity removes Legacy animation. To add more animations, drag them into your controller and make transitions from idle to the new animations and set parameters. For instance, I used bool and called it run in the animator controller. Make sure the bool name matches the name of the animation box in the animator controller (I always rename the box… click on it to do this.) Also, make sure you delete the default main camera so it doesn’t conflict with the character controller one.
That’s it.
Here is the C# code I added to the avatar…
using UnityEngine;
using System.Collections;
public class defaultAnimator : MonoBehaviour {
Animator def;
public bool run = true;
// Use this for initialization
void Start () {
def = GetComponent<Animator>();
}
// Update is called once per frame
void Update () {
if(Input.GetKey(KeyCode.W) || Input.GetKey (KeyCode.S) || Input.GetKey (KeyCode.A) || Input.GetKey (KeyCode.D))
{
def.SetBool("run", true);
} else {
def.SetBool("run", false);
}
}
}