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
- NullReferenceException errors appear in the Console when changing the values of Visual Effect Control Clip Events' Attributes
- Crash on TextCore::OTL_TableReader::GetOpenTypeLayoutTables when using Japanese Font as TMP Fallback
- TreeView.AddItem performance regression when opening EditorWindow
- Shadows are not visible in Player when using DX12 with Forward+ or Deferred+ rendering in URP
- Rendering Debugger Playmode debug UI scrolling is jittery when using click and drag to scroll
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.