Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Uping · Aug 06, 2014 at 04:46 PM · animationanimatorbooleanrepeat

My animation keeps on repeating on my animator

my problem is my animation keeps on repeating on my animator here's the screen shot alt text

okay the problem is when WrongAnswer = true is executed it wont stop playing so what I did is i put another idle so it will go there after playing but if I want to play WrongAnswer again i wont play it because there's no arrow to go back but if i put arrow to go back it will again not stop playing so what should i do i tried many things but i end up to the animation not stoping, what i want is my animation to just play wrong answer once then go back to idle then if a certain confition is applied it will play again only once then go back to being idle again. so how can i do that im trying to figure this out all day and i cant find the answers so please help me thank you, heres a sample code for it

 private void HandleAnswer(int answer) {
                         
                             if (answer == 1)
             
                         {
                             
                             anim.SetBool("WrongAnswer",true);
                             Attack();
                             NextQuestion();
                         
 
                         }                                
                             else { 
                             anim.SetBool("WrongAnswer",false);
                             
     {    
first condition.png (85.7 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · Aug 06, 2014 at 04:49 PM 0
Share

You only have transitions IN to the Animation states. You must provide Transitions FRO$$anonymous$$ the state also, in order for the State to not become stuck.

avatar image Uping · Aug 06, 2014 at 04:54 PM 0
Share

if i put another transition from idle 0 to idle it will just circulate and go back to wrong answer again and again im a beginner im sorry

avatar image meat5000 ♦ · Aug 06, 2014 at 05:02 PM 0
Share

Perhaps have it exit the state to an empty one.

Anyway, its all in the transitions.

avatar image Uping · Aug 06, 2014 at 05:09 PM 0
Share

yea but if added an empty one there just like this alt text

it will just stop there and wont go back to idle because its empty anyway thanks for trying to help me

empty.png (26.5 kB)

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by liortal · Aug 06, 2014 at 05:08 PM

You need to go back to the "idle" state, since no transition is configured from the new state you added back to "Wrong Answer".

If you want to trigger a state change, you can use the anim.SetTrigger API instead of setting a bool with a value.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Uping · Aug 06, 2014 at 05:22 PM 0
Share

when i go back to idle state it will loop again and go to wrong answer animation and go back to idle and loop again and wont stop forever,

what i need is to loop it once from idle to wrong answer and idle angain then stop,

then again after a certain condition or for example i press a button it will loop again from idle to Wrong answer animation to idle again once more.

can you give me an example im really a beginner and i cant quite understand your answer but thanks for trying

avatar image meat5000 ♦ · Aug 06, 2014 at 05:24 PM 0
Share

Add more Parameters to your Transitions and trigger them via script.

avatar image Uping · Aug 06, 2014 at 05:32 PM 0
Share

okay i get it thank you :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Scripting animations 2 Answers

Set boolean to false when animation changes? 1 Answer

How to set an Animator Boolean with JavaScript 1 Answer

2d animation how to stop your animation and set a condition 0 Answers

using sample assets beta, how to add animation to the third person character? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges