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 /
  • Help Room /
avatar image
0
Question by Lathspell · Feb 13, 2016 at 12:17 AM · animationrotationuicanvasimage

Unable to make animations for UI Image

I'm trying to create an animation that rotates an UI image. I've done that in that sam eproject, so it should be possible. But whenever I change the rotation value at any frame, it resets.

According to the curves, it's actually taking the values correctly to create the curve, but for some reason it resets on the Dopesheet, and on play the animation is not played

This seems to affect only rotation, other properties can be modified. And is not just in one Image, is in every new Image I try to animate

alt text

alt text

I can't tell if I'm doing something wrong or my project just get corrupted. An yone knows what's goign on here?

sin-titulo.png (28.4 kB)
sin-titulo1.png (28.7 kB)
Comment
Add comment · Show 2
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 Lathspell · Feb 15, 2016 at 02:19 PM 0
Share

I've tried again, now it gives me this error:

NullReferenceException UnityEditorInternal.CurveBindingUtility.SampleAnimationClip (UnityEngine.AnimationClip clip, Single time) (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Animation/AnimationWindow/CurveBindingUtility.cs:66) UnityEditorInternal.CurveBindingUtility.SampleAnimationClip (UnityEngine.GameObject rootGameObject, UnityEngine.AnimationClip clip, Single time) (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Animation/AnimationWindow/CurveBindingUtility.cs:39) UnityEditorInternal.AnimationWindowState.ResampleAnimation () (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Animation/AnimationWindow/AnimationWindowState.cs:779) UnityEditorInternal.AnimationWindowState.set_currentTime (Single value) (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Animation/AnimationWindow/AnimationWindowState.cs:1215) UnityEditor.AnimEditor.PlaybackUpdate () (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Animation/AnimationWindow/AnimEditor.cs:231) UnityEditor.AnimEditor.Update () (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Animation/AnimationWindow/AnimEditor.cs:166) UnityEditor.AnimationWindow.Update () (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/Animation/AnimationWindow/AnimationWindow.cs:42) System.Reflection.$$anonymous$$ono$$anonymous$$ethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/$$anonymous$$ono$$anonymous$$ethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.$$anonymous$$ono$$anonymous$$ethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/$$anonymous$$ono$$anonymous$$ethod.cs:232) System.Reflection.$$anonymous$$ethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/$$anonymous$$ethodBase.cs:115) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/HostView.cs:187) UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/HostView.cs:180) UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/$$anonymous$$ono/HostView.cs:245) UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:217)

avatar image lassade · Feb 16, 2016 at 10:00 PM 0
Share

Im using the 5.3.1f1 and have the same problem. Even in script does not rotate at all.

Edit: I mean only with script i can spin a UI Image

1 Reply

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

Answer by lassade · Feb 16, 2016 at 10:21 PM

I tried with a a clean scene and also have this problem, so my suggestion is:

  1. Update Unity to the most recent version, (if is too much work try search in the change log for this bug fix frist)

  2. Build a script to do the rotation: (Hack)

If is a simple rotation do Like this:

 public class Rotate360 : MonoBehaviour {
 
     public float speed;
     
     // Update is called once per frame
     void Update () {
         transform.rotation = transform.rotation * Quaternion.Euler(0, 0, speed * Time.deltaTime);
     }
 }

For more complex stuff use this script and simple animate the rotation field (Not Tested)

 [ExecuteInEditMode]
 public class ApplyRotation : MonoBehaviour {
 
     public Vector3 rotation;
     public Transform t;
 
     // Use this for initialization
     void Start () {
         t = transform;
     }
 
     // Update is called once per frame
     void Update () {
         t.rotation = Quaternion.Euler(rotation);
     }
 }


Comment
Add comment · Show 2 · 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 lassade · Feb 16, 2016 at 10:23 PM 0
Share

Change the rotation to localRotation.

avatar image Lathspell · Feb 17, 2016 at 02:55 PM 0
Share

5.3.2 solved it, thanks for the advise!

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

84 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

Related Questions

How to match position with Mini Map UI 0 Answers

How to have get button display a raw image? 3 Answers

How to move a UI Image in the z axis? 2D 0 Answers

Hotbar appears when a certain gameobject is selected? 1 Answer

How to make an object the root of a prefab, or remove the canvas that is set as the root of a prefab 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