- Home /
Can an animation frame be incrmented?
Hi I've been trying to get an animation to only change frames when a player is hurt but I keep getting a NullReferenceException error and I don't know why it keeps on happening.
Here is my code: private Animator a; private movement player; private string b;
// Use this for initialization
void Start () {
b = animation.name;
animation.Stop();
player = GameObject.Find("Dad(clone)").GetComponent<movement>();
}
// Update is called once per frame
void FixedUpdate () {
print(b);
animation["HealthBar 1_0"].time = .2f;
}
The error marks the animation["HealthBar 1_0"].time = .2f; and I am not sure why. Any help?
Comment