Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Animator problem start animation

$
0
0
Hello everyone! When I press the left mouse button on a box collider should animate a second animation. when I press the button I get this cluster error: Invalid Layer Index UnityEngine.Animator: Play (String) $: MoveNext () (at Assets / x ninja / Code / Upload blocking livello.js: 18) UnityEngine.SendMouseEvents: DoSendMouseEvents (Int32, Int32) What could be the problem? script: var levelToLoad : String; var soundhover : AudioClip; var beep : AudioClip; var QuitButton : boolean = false; var anim : Animator; function Start() { anim = GetComponent("Animator"); } function OnMouseEnter(){ audio.PlayOneShot(soundhover); } function OnMouseDown(){ anim.Play ("Secondo"); audio.PlayOneShot(beep); yield new WaitForSeconds(15); if(QuitButton){ Application.Quit(); } else{ Application.LoadLevel(levelToLoad); } } @script RequireComponent(AudioSource)

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>