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
I tried with a a clean scene and also have this problem, so my suggestion is:
Update Unity to the most recent version, (if is too much work try search in the change log for this bug fix frist)
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);
}
}