- Home /
How to fix odd interpolation issues in Unity
Hi there,
I'm currently at the tail end of a game project creating 3d assets for export to Unity.
I am trying to export animation (cut scenes , animation states ) from 3ds max to Unity and have come across a strange issue regarding interpolation / curves in Unity.
To give an example of this issue. In 3ds max, I have a flat 2D character who rotates 180 degrees over 1 frame, so he can seamlessly flip and change directions (No interpolation). I have exported this animation as a FBX and brought it into unity.
All the animation loads perfectly except for one recurring issue. I have noticed that for some reason Unity is changing the curves and adding interpolation to the frames that are animated on ones in 3ds max. So instead of flipping over 1 frame as it is in 3ds max, the character turns over 6 frames in Unity.
It has nothing to do with our rig, as I have tested a simple box from 3ds max, and it has the same problem.
Now, ill be honest, I am pretty much a new comer to Unity, and am only using it to test the assets before sending them the coders...
I am sure this is an easy fix but I need to resolve it as quickly as possible and I would appreciate any help from the community.
Cheers.
Could it be the compression? If you click on the Animation and check the settings in the inspector there should be a Anim. Compression variable. Set it to Off and Apply.
Also, because you mention it animates over 6 frames ins$$anonymous$$d of 1, does the setting in the importer show that it is 1 or 6 frames?
Hi Game,
Thanks for your suggestions,
I've tried the different compression settings in Unity without much luck. It doesn't seem to make a difference to this particular issue.
However, I did make a mistake earlier in my post saying that it interpolates over 6 frames in Unity. I didn't realise that the preview window in Unity does not go frame by frame ( like 3D max's timeline does ) if you navigate using left and right directional keys....
On further exa$$anonymous$$ation, I think it is still animating over 2 sequential keyframes. Unity is just showing a lot of subframes (interpolation ) in the viewport.
However, this leads me to ask, is this just how Unity is , or is there a way to control the subframes / playback settings ?
I think this is the right train of thought, however I have no idea how to resolve things past this...
Cheers
Answer by Klakwa · Feb 20, 2014 at 02:30 PM
My guess would be to check out the tangents on the keyframes in your max scene and set them to stepped (or whatever Max has), so there is no interpolation between the frames (even if you have a keyframe on frame 1 and another one on frame 2 there is infinite amount of subframes in between of those two and it's usually used to render motion blur).
So if you're running your animation in Max in let's say 30 fps, then you won't see the interpolation happening, but since you're importing it to Unity and it runs at variable fps it will show the interpolation then.
Hi $$anonymous$$lakwa,
Thanks for your suggestions.
I had tried that process before, setting the keyframes to stepped in max first before importing the animation, thinking that might solve the issue, but it unfortunately didn't make a difference.
I've tried it again here just to double check, but again, no luck :(
I have a feeling it has something to do with Unity's frame rate or how it is interpreting the subframes but I'm not sure how to resolve the problem. (whether the fix is in Unity or 3ds max)
I was hoping to view the curve's inside Unity's animation editor, just to see if I could spot / fix the problem there, but I only have the trial version of Unity and don't think I can access/edit the curves, unless I am mistaken..
Thanks again,
Answer by danilonishimura · Mar 07, 2014 at 06:38 PM
Use the Animation window to view and edit all keyframes. When you select a keyframe, click the elipsed icon right after the node's name and change the keyframe's interpolation to 'constant', which is the equivalent to 3ds max's steped interpolation.
The elipsed icon i'm referring is the cyan/magenta/yellow colored icon as shown on the page below: http://docs.unity3d.com/Documentation/Manual/UsingAnimCurves.html
Answer by AlexwellZ · Dec 19, 2014 at 10:52 PM
http://answers.unity3d.com/questions/187907/how-to-add-keyframes-on-imported-read-only-animati.html actually I found this answer and it helped me to solve exactly the problem of auto-interpolation of imported keys.
Your answer
Follow this Question
Related Questions
scaling bone animation of salamander tongue looks fine in max but breaks in unity 1 Answer
Weird animation problem (FBX) 0 Answers
FPS Game animations help! 1 Answer
Unity Animation Interpolation Problem 0 Answers
Linear animation curves 2 Answers