- Home /
Question by
hardmode2236 · Nov 21, 2013 at 04:45 AM ·
animationarraycomponent
access the animation array in an animation component.
in the inspector of my animation component, i have an big array full of animations. but i don't see a way in the scripting reference to access them. but i need to check them for their length when they play. if i could access them by name it would really help my script. is there a way to do that?
Comment
Best Answer
Answer by clunk47 · Nov 21, 2013 at 04:56 AM
using UnityEngine;
using System.Collections;
public class AnimationExample : MonoBehaviour
{
void Start()
{
print (animation["Walk"].length);
}
}
oh man i can't believe its that easy >.<
iv been trying to code around that for a day and half. thanks!