I can't understand why this isn't working. I've been going through all the threads on here and Unity Answers and I'm still missing something. This is a script directly copied from Unity's Scripting reference. The script is attached to the moving object, everything has colliders which are working because the moving object bounces off but the animation doesn't trigger. I just want the moving object to have one animation while it's moving and then another after it hits something. Thank you. function onCollisionEnter(col : Collision) { if(col.gameObject.name == "Bat_Death") { animation.Play("Death", PlayMode.StopAll); //audio.PlayOneShot(AudioClip); } }
second pair of eyes and all that... happens quite a lot also: http://forum.unity3d.com/threads/using-code-tags-properly.143875/