Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2020.3
2021.1
2021.2
2021.2.0b4
2022.1
Issue ID
1355176
Regression
No
Animation clip that is created using GameObjectRecorder is shorter than the original Animation clip
How to reproduce:
1. Open the user's attached project and Scenes/SampleScene scene
2. In the Project browser, select FBX (see notes)
3. In the Inspector window, select Animation and observe Animation clip Length (0.667)
4. Enter the Play mode (Animation clip will be created) and select Ok in the pop-up window
5. In the Project browser, select AnimationsRetargettedFromHumanoid/NewClip.anim
6. In the Inspector window, observe the Animation clip Length
Expected result: 0.667 seconds
Actual result: 0.650 seconds
Reproducible with: 2019.4.29f1, 2020.3.17f1, 2021.1.17f1, 2021.2.0b8, 2022.1.0a5
Add comment
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
Resolution Note:
This is by design.
As mentioned in the API documentation `GameObjectRecorder.TakeSnapshot` does not apply the delta time parameter the first time it's called and instead adds a keyframe at time 0. Subsequent calls will apply the delta time.
link: https://docs.unity3d.com/ScriptReference/Animations.GameObjectRecorder.TakeSnapshot.html
To make your example work, just call `_Recorder.TakeSnapshot(0f)` first before you start iterating on keyframes.