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
- [URP] Crash on GameObject::QueryComponentByType when baking a Reflection Probe in an unsaved/untitled Scene
- No Icons are used for the Entry and Exit States in the Inspector when selected in an Animator Controller
- Crash on PlayerMain(int, char const**) when exiting Standalone Player with a Particle System in the Scene
- No Icon is used for the Runtime Animator Controller Type in a Search Window when assigning an Animator Controller in the Animator Component
- Unity Version Control server textfield’s text overlaps with the dropdown triangle button in the Explore repositories window when an organization with a long name is selected
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.