- Home /
Animation component in Unity 4.3 doesn't work?
The new Unity animation method has totally confused me. I used to have version 4.0.1 and this script worked perfectly fine with animations.
var someNumber : System.Decimal;
someNumber = 0;
animation.Play("Name");
animation["Name"].speed = someNumber;
function OnTriggerEnter(other : Collider){
if(other.tag == "Name");
someNumber = 1;
animation.Play("Timer");
animation["Name"].speed = someNumber;
}
I attached this script and the Animation component to the object and it worked fine. Now I've upgraded to version 4.3.2 and now creating new triggered animations won't work because it uses the Animator component which seems to ignore this script completely. I basically need to now how to exchange the Animator component for the Animation component without it saying it can't find the animation, or is it the script that has to be changed? Thanks for any answers.
Answer by Loius · Feb 07, 2014 at 05:36 PM
Just replace the Animator component with an Animation component.
(right-click "Animator" in inspector, remove component; add component, type "Animation")
Yeah, I've already tried that and it gives me this error:
The animation state Name could not be played because it couldn't be found! Please attach an animation clip with the name 'Name' or call this function only for existing animations. UnityEngine.Animation:Play(String)
I have put the animation itself on the component too.
Replace Name with the name of the animation...
You're playing an animation named "Timer" and setting the values of an animation named "Name".