- Home /
Question by
HanEisa · Jun 14, 2014 at 11:44 PM ·
animatoranimation script
Script for play parent gameobject animation
Hi everyone.
i created 3 cube, and added them as child to an empty gameobject. then in unity editor i animated that gameobject,unity added animator component. now i wanna control and access to play and stop this animation with js script.and i dont know how i can do it.i searched all the day to find a way.please help me :)
all the time i have this error :
The animation state Boileran0 could not be played because it couldn't be found!
var boiler0 : GameObject;
var Boileran0 : AnimationClip;
function Start () {
}
function Update () {
if (Input.GetMouseButton(0)){
boiler0.animator.CrossFade("Boileran0");
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613151544im_/https://answers.unity.com/themes/thub/images/avi.jpg)