Search Issue Tracker
Fixed in 5.1.0
Votes
0
Found in
4.2.0f4
Issue ID
559723
Regression
No
AnimationCurve created by script has a very steep transition
When creating an animation by code (add KeyFrame to AnimationClip then finally add AnimationClip to Animation and Play() ) if making a keyframe for "rotation" you will get a special keyframe that will have a sharp broken at the middle of 2 keyframes.
2) How can we reproduce it using the example you attached
Try this on a GameObject that has Animation component attached
AnimationClip dieAnimation = new AnimationClip();
AnimationCurve rotationCurve = new AnimationCurve();
rotationCurve.AddKey(new Keyframe(0.5f,0.3f,0,0));
rotationCurve.AddKey(new Keyframe(1,0,0,0));
dieAnimation.SetCurve("",typeof(Transform),"localRotation.z",rotationCurve);
animation.AddClip(dieAnimation,"dieAnimation");
animation.Play("dieAnimation");
At runtime check the newly created AnimationClip in the Animation Editor to see that the light-blue keyframe belongs to localRotation.z has a very weird shape. Try drag around for a weirder shape. (If the two are really close, the shape will be ok)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Add comment