- Home /
The AnimationClip 'Attack' used by the Animation component 'Knife' must be marked as Legacy.
So yeah, help would be appreciated. This is my script:
#pragma strict
var TheDammage : int = 50;
var Distance : float;
var MaxDistance : float = 1.5;
function Update ()
{
if (Input.GetButtonDown("Fire1"))
{
animation.Play("Attack");
var hit : RaycastHit;
if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit))
{
Distance = hit.distance;
if (Distance < MaxDistance)
{
hit.transform.SendMessage("ApplyDammage", TheDammage, SendMessageOptions.DontRequireReceiver);
}
}
}
}
Comment
Answer by hlynbech · Oct 01, 2014 at 08:35 PM
When importing animations, check the import inspector (comes up when you select the animation object or FBX or whatever in the Assets folder).
Under "Rig", you can select "Legacy".
Your answer
![](https://koobas.hobune.stream/wayback/20220613164152im_/https://answers.unity.com/themes/thub/images/avi.jpg)