I have this script:
function Update
{
if(Input.GetButtonDown("Jump"))
{
var animationComp : Animation[] = GetComponentsInChildren(Animation);
for (var animComp : Animation in animationComp)
{
animComp.Play("grab sword");
}
}
}
I found this script so i could play an animation in the game objects child, and when i play and click space i get this error:
InvalidCastException: Cannot cast from source type to destination type. walker.Update () (at Assets\my scripts\walker.js:21)
How do i fix it so when i click space the animation plays?