Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 coykto · Mar 01, 2018 at 04:51 AM · animationrecttransformtimeline

Animating RectTransform in Timeline

I've created a plane on the canvas (empty RectTransform) with these values:

alt text Then i've created an Image as a child of that plane. RectTransform values: alt text

Now i want to animate movement of that image using Timeline. So i create a new empty GameObject, add PlayableDirector to it, assign (newly created) Timeline, then I added animation track to that Timeline and assigned my Image to that track (I added animator to Image object when it asked me to). So far so good. Then I animated change of the scale of my Image and it went perfectly (as expected).

The issue: when i try to animate change in anchored position (PosX and PosY) I set keyframe at the beginning of the animation so that PosX and PosY are equal to zero. Move few frames away and when i try to change value of PosX or PosY it just snaps back to the zero. And if i go to the Animation window and change PosX value there, I end up with the animation where every other frame my image is on zero coordinates and next frame it is where it should be. So it just flickers from supposed position to the zero coordinates and back.

What I've tried:

  1. Adding canvas component to the parent panel.

  2. Making parent panel fixed size.

  3. Changing pivot for both parent panel and Image.

chestrecttransform.jpg (53.9 kB)
emptyrecttransform.jpg (55.0 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
2
Best Answer

Answer by coykto · Mar 01, 2018 at 05:49 AM

So, for anybody with the same problem:

I also changed rotation of my Image and apparently that was what caused the problem. I figured that when you rotate your image, it's bounds changes and that causes it for some reason to reset PosX and PosY values.

If you want to move and rotate ui element, simply create "image_container_panel" (another empty RectTransform) and make your image child of it. Now we want to animate rotation and translation in the separate animation tracks. One track for translation where you animate PosX and PosY values of "image_container_panel" and another one for rotation where you animate rotation of an element (image).

Comment
Add comment · Show 1 · 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 seant_unity · Mar 01, 2018 at 01:04 PM 0
Share

Yes, this is related to an open issue - https://issuetracker.unity3d.com/issues/timeline-object-starts-jittering-if-there-are-two-near-by-key-frames-in-animation-that-have-the-same-position

The issue is a conflict with an optimization in RectTransform, and how timeline animates objects when the rotation is being animated. The UI $$anonymous$$m is looking into, and hopefully will have a resolution soon.

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

203 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

1 FPS in Unity Timeline 0 Answers

Why isn't Cinemachine switching between cameras? 0 Answers

How to record animation in timeline? 1 Answer

How to create a cutscene on a specific spot in the game environment using cinemachine and timeline? 0 Answers

When triggered in Timeline, Animations that modify a property on a GameObject will have that property reset by a second Animation that does not modify that property. How do you avoid this? 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