Closed Airat1995 closed 6 years ago
Yes, you can play an animation from code. I guess the error was caused by the previous reference(dgb or UnityArmatureComponent or animation). You can find out which reference is empty at the breakpoint.
Ok, thanks. Mb lost animation somewhere.
Hi! Can I play an animation from code if I created it from the editor and saved as prefab? Why if I use code like that I got and NullRefrenceException?
dgb.GetComponent<UnityArmatureComponent>().animation.Play("Calm");
Or I must define data from code to make unit animated?