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
- Crash on ShaderLab::ShaderState::ApplyShaderState when entering Play Mode and calling ShaderWarmup.WarmupShaderFromCollection with a shader that has dynamic_branch
- Crash on operator delete[] when a serializable structure in the System namespace is serialized by a MonoBehaviour
- [macOS] forward and backward mouse buttons are recognized as middle mouse button
- NavMeshModifier.OnEnable/OnDisable gets progressively slower when called repeatedly
- "System.Net.CookieContainer" throws an "ArgumentException" error when using a non-UTF-8 machine locale and hostname
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.