Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.4
2019.4.18f1
2020.2
2021.1
2021.2
Issue ID
1312817
Regression
No
error CS0103: The name 'AnimationUtility' does not exist in the current context when building the project
Reproduction steps:
1. Open project "Animation.zip"
2. Build the project
Expected result: Project build successfully
Actual result: this error pops up: Assets\anima.cs(15,9): error CS0103: The name 'AnimationUtility' does not exist in the current context
Reproducible with: 2018.4.32f1, 2019.4.21f1, 2020.2.6f1, 2021.1.0b7, 2021.2.0a6
Notes:
- No errors when running on Editor
- According to https://docs.unity3d.com/ScriptReference/Keyframe-tangentMode.html was replaced by AnimationUtility.SetKeyRightTangentMode
- Keyframe.tangentMode belonged to UnityEngine library while AnimationUtility.SetKeyRightTangentMode belongs to UnityEditor library
Comments (1)
-
CyberSherif
Aug 21, 2023 19:30
#if UNITY_EDITOR
AnimationUtility.....
#endif
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
Resolution Note:
While `Keyframe.tangentMode` was accessible at runtime, changing it didn't do anything. It's used specifically by the Animation Window to adjust the tangent automatically when changing keyframe. Hence the reason why we moved the functionality in UnityEditor.
To change the tangent at runtime, you'll need to change `Keyframe.inTangent` and `Keyframe.outTangent` manually.