Hello,
I need some help with playing an animation after a ball has hit a target. The code is in C#. I've tried playing the animation by first declaring it. I've also tried to play it by using the getComponent method. When the ball hits the target, the animation dosen't play. It's just a still frame. Any help is greatly appericated. I can provide more code or info if it is needed.
Animation LightWoman;
void OnCollisionEnter(Collision col) {
if(col.gameObject.CompareTag("ball") && col.gameObject.CompareTag("Doofus1"))
{
this.GetComponent<Animation>().Play("DoofusAni");
}
else if(col.gameObject.CompareTag("ball") && col.gameObject.CompareTag("lightwoman1"))
{
LightWoman.Play("LightWomanAni");
}
}