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 mk22 · Mar 31, 2015 at 11:28 AM · 2d animation

Animation doesn't start if I set Transition Duration to 0

Hey,

I have a problem with animations. I have one animator controller and 4 animations. I want to change animation randomly after I click mouse button. I have one Integer parameter 'whichFly' and made condition in every transition. alt text

When user click a mouse button I randomly choose in script which animation plays:

 myAnimator.SetInteger ("whichFly", 11); // and so on

Animation changes good, but it stays in one single graphic frame.

This is my game object alt text

Every animation plays fine only when I change Transition Duration to value greater than 0. But i want to change my animation immediately after user clicks a mouse. Do you know what is my problem?

Thanks.

animator.png (67.9 kB)
gameobject.png (40.4 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by sumeeton · Mar 31, 2015 at 11:36 AM

I'm not sure what your problem is. Are you complaining about the delay in transition when mouse click occurs? Can you show where did you put the mouse click code?

Comment
Add comment · Show 6 · 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 mk22 · Mar 31, 2015 at 12:55 PM 0
Share

The animation shows at the screen but it look like image or photo. For example if my animation has got 8 frames it stays only at first so it looks like static photo.

Yes. It works fine (frames in animation chenge so it looks like real animation) but only when I set Transition Duration for exaple to 1 or 0.5 but I dont want to any delay

I put it into Update() function.

Hmmm... my animation has got 8 frames if I set Transition Duration in low value for exaple 0.3 it only play frames 1 and 2. If I set Transition Duration to 1.0 it plays all frames correctly 1,2,3,4,5,6,7,8

I thought Transition Duration is time between animation. Am I right?

avatar image sumeeton · Mar 31, 2015 at 03:33 PM 1
Share

Uncheck the Can Transition To Self in the inspector for each transition. This should solve your problem.

avatar image mk22 · Mar 31, 2015 at 05:34 PM 0
Share

thanks a lot. It works. Can you tell me why?

avatar image sumeeton · Mar 31, 2015 at 05:48 PM 3
Share

Sure. What is happening is that when an integer is set to say suppose 2 the transition will take place for value 2. But the value is still 2 and the transitions in your animator are from AnyState. So it keeps going from AnyState to the State you wanted continuously till you set the integer to a different value. The same will happen with that state too if the transition is from AnyState. So, we uncheck CanTransitionToSelf so that if the state is 'Fly1' we don't want to trigger it again and remains in the same state. Hope that helps.

avatar image mk22 · Mar 31, 2015 at 05:54 PM 0
Share

thanks for help.

Show more comments

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

2D animation,rotate the character walking animation once. 1 Answer

Creating 2d spritesheet from 3d models 1 Answer

How do I change "Any State" on Animator to "Any Other State"? 0 Answers

Building a character as part of the gameplay 0 Answers

Animation clips not staying with Character 0 Answers


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