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
- Shader Graph Asset icon is not shown on creation unless you confirm the name
- APV Sky occlusion doesn't consider the terrain
- [iOS] "EXC_BAD_ACCESS" Player crash when Script Debugging is enabled
- Cursor skips input fields when tabbing between two sets of input fields
- "Shader error redefinition of 'Varyings'" error appears when selecting the shader
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.