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
1
Question by da_st · Mar 12, 2015 at 03:01 PM · animationuiimage

UI Animation not playing/updating?

Hey, i have a UI image setup like this:

alt text

The animation makes it slide form the right to the left, and setting the "fill amount" from 1 to 0.

When I play the animation in the scene view it works like it should, but in the play mode it doesn't animate at all, I can see that the "fill amount" value is decreasing in play mode, but the image wont move. Anyone know what i could do to fix this?

This is how I play the animation:

         stopwatchSlider.gameObject.GetComponent<Image> ().enabled = true;
         stopwatchSlider.gameObject.GetComponent<Animation> ().enabled = true;
         stopwatchSlider.animation.Play ("stopwatchSlider");
namnlos.png (38.5 kB)
Comment
Add comment · Show 5
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 fffMalzbier · Mar 12, 2015 at 01:11 PM 1
Share

Im not sure why but with the "Animation" Component it does not work. Using the "Animator" Component it works fine.

avatar image da_st · Mar 12, 2015 at 01:25 PM 0
Share

Okay but thats weird because ive been able to use the animation component before with UI :/ but thanks i will try the animator

avatar image Noxury · Aug 30, 2015 at 01:38 PM 0
Share

Are u german? :D Have you already solved this?

avatar image da_st · Aug 30, 2015 at 05:25 PM 0
Share

Hey i think i solved this by using the "Animator" ins$$anonymous$$d of "Animation" but i dont really remember , and i am from Sweden! :D

avatar image taxvi · May 22, 2016 at 01:37 PM 0
Share

It's funny, I encountered with this on a game jam. I didn't have much time but I discovered that disabling and re-enabling UI elements in the inspector would actually update them correctly with animation. But it would update only the current frame when it got re-enabled, it still would not play. So I just added this 2 lines in update:

uiElement.enabled = false; uiElement.enabled = true;

it worked, I know it was a crappy solution but Jam was ending so I didn't care :D

0 Replies

· Add your reply
  • Sort: 

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

What is the best method to display different pictures? 0 Answers

Animating UI Images - Wondering if there is a more formal way of doing things... 0 Answers

How do you make an UI animation longer than one second? 3 Answers

Button animator not playing. 0 Answers

Unity 5.2 Canvas.RenderOverlays serious fps hit 2 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