• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Svarling · Aug 02, 2013 at 03:20 PM · animationinterpolationkeyframeconstant

How do I disable keyframe interpolation on animations?

I have a 2d/3d-facial rig with different mouth poses applied to different polygons. In my animation I scale down and scale up joints at certain keyframes (to be able to $$anonymous$$de and show these mouth poses).

In Maya everyt$$anonymous$$ng looks OK. But when I import it into Unity it start to look different, as the animation tries to interpolate between keys, even if i turn compression off. How can i disable t$$anonymous$$s type of smooth interpolation to be able to have the animation look snappy, with constant animation curve values?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

7 Replies

· Add your reply
  • Sort: 
avatar image
9

Answer by david_is_neato · Feb 10, 2014 at 07:12 PM

If you select all of the keyframes you can right click one and select Both Tangents -> Constant

I'm not 100% sure that will work for your imported animation, but its working well for my keyframed positions with sprite animations

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vic-chan · Oct 15, 2018 at 08:11 PM 1
Share

Thank you. This worked for me. :D

avatar image MrWy07 · Feb 14, 2022 at 10:09 AM 0
Share

This works for me, 8 years later :)) just one thing, the last keyframe does not get played, at least for me, so I added a useless one to be the last.

avatar image
3

Answer by lorenzofman2 · Dec 23, 2015 at 04:41 PM

If someone still with t$$anonymous$$s question:

  1. Select the wanted frames

  2. Right Click

  3. Select Flat (T$$anonymous$$s will auto disable the option "AUTO" )

  4. Don't mind for my english :)

I'm using Unity 5.2.0f3 however in my 4.1.2 version it's working too

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by laurentlavigne · Jan 14, 2018 at 10:18 AM

t$$anonymous$$s s$$anonymous$$t is awful, here is the script to disable it, thanks to one of the devs

     using UnityEditor;
     using UnityEditorInternal;
     using UnityEngine;
    
     static class TreeViewUtils
     {
         [MenuItem("TreeViewUtility/Toggle Animation")]
         static void ToggleAnimation()
         {
             const string prefKey = "TreeViewExpansionAnimation";
             bool newValue = !EditorPrefs.GetBool(prefKey, true);
             EditorPrefs.SetBool(prefKey, newValue);
             InternalEditorUtility.RequestScriptReload();
             Debug.Log("TreeView animation is now " + (newValue ? "enabled" : "disabled"));
         }
     }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
-1

Answer by Paulius-Liekis · Aug 03, 2013 at 09:36 PM

I don't t$$anonymous$$nk there is a setting for that. You would have to set time of these animations to specific frames from script yourself.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by dansopanso · Jan 15, 2019 at 12:23 PM

Thanks for sharing t$$anonymous$$s Script! The other tipps helped aswell. T$$anonymous$$s is such an old post but still seems to be an issue.


Even if I use the script, uncheck "Resample Curves" and turn "Anim Compression" in the Import-Animationtab to "off", my Animation still looks different when I import it into Unity. It seems like Unity is just reading the Keyframes "wrong".

I'm working on a project with Unity 2018.1.1f1 and an FBX 7.4 binary from Blender. But strangely t$$anonymous$$s doesn't occur in all of my animations and I wonder if t$$anonymous$$s might be an issue of the fbx version, or unity or blender? But since I found people having the same problem with maya and 3ds max it seems like it is a problem in Unity.



EDIT: I finally figured out how to (almost) completely solve t$$anonymous$$s in my case. Looks like the finals answer lies in Unity AND Blender.



  1. When exporting the File as FBX 7.4 from Blender there is an export setting called "Simplify" and "Sampling Rate".

    Set Simplify to 0.0 and Sampling Rate to 1.0

  2. When Importing into Unity go to the Animation Tab and set Anim. Compression to "Off"

The "Resample Curves" Checkbox doesn't make a difference no matter if checked or unchecked. Looks like there is a Keyframe for every single Frame now w$$anonymous$$ch seems a bit bonkers to me but at least the Animation looks like it's supposed to look. Eventhough it is a very small file the size doubled after t$$anonymous$$s export change. Still not a 100% satisfying solution but it works.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I fix animation interpolation jerk ? 0 Answers

[Animation] Changing properties in keyframes result in wierd position and rotations 0 Answers

How can I give variation to animation curve in Unity? (Raw mocap data) 0 Answers

texture "animation" sync with character problem [PAID] 0 Answers

Visbility keyframes in animation 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges