Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

checking if an animation is playin

$
0
0
hi ım trying to make if a spesific animation is playing some code will not be executed but its not working.I want to change the scene when mainmenuchange animation is over
Code (CSharp):
  1.  
  2. public void play()
  3.     {
  4.         ımage.SetActive(true);
  5.         GetComponentInChildren<Animator>().Play("mainmenuchange");
  6.    
  7.         if (!GetComponentInChildren<Animator>().GetCurrentAnimatorStateInfo(0).IsName("mainmenuchange")){
  8.             SceneManager.LoadScene("begin");
  9.         }
  10.     }
  11.  

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



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