Forum rules - please read before posting.

How to disable keyframe interpolation in legacy animation?

I'm not sure, if this is an AC or Unity question, so sorry if it's not supposed to be on this forum.

I have a 3D character imported as FBX from Blender animated with Legacy. The animation now is very fluid, but I want it to be a bit stuttering. The animation is an 8 frame walk cycle. When I view the animation in Blender, it's perfect, but in Unity/AC it's very fluid, which means there must be some kind of interpolation between the keyframes. Also, between frame 8 and 1 it jumps, which I guess must mean for some reason it doesn't interpolate between frame 8 and 1.

How can I turn off this interpolation?

Comments

  • This is indeed a Blender/Unity question, not one related to AC.  Posting on the Unity forums would be more appropriate as you'll likely get better answers.

    However, make sure that you have your Blender keyframes set to Constant interpolation.  Unity is interpolating between them, but I'm not sure if they'll override the interpolation mode you set in Blender or not.  If they do, you might need to find a way of editing the animation curves in Unity directly - but again, for that kind of help you'll need to look to more general Unity forums.
  • Thank you for the reply, @ChrisIceBox !

    I tried making the interpolation Constant in Blender, however Unity still interpolates between the frames. I read somewhere that to change the interpolation mode, I have to duplicate the animation from the fbx in Unity (because as long as it's still in the fbx, it's read only), and then change the interpolation mode in Animation.

    However, when I try to assign the edited animation to my Player's Standard 3D Animations in AC, it doesn't work. He simply stays in the Idle animation when walking. As I mentioned before, I'm using Legacy animation - for that to work, do the animations have to be in the fbx? If no, then how can I assign an 'external' animation to my Player? If yes, which mode should I use to be able to assign animations that I have extracted from the fbx?
  • You should generally rely on the Mecanim animation engine (Animator system) for animation playback unless you have a real need for Legacy.  It might be that duplicating the fbx forces the animations to be non-legacy, but that'd be for Unity to answer.  I'd recommend switching your Rig to Humanoid or Generic and your AC Animation engine to Mecanim.
  • Okay, the reason why Legacy seemed like the better choice was that I basically want to animate my 3D models as if they were sprites, to get a sort of old school feel to the animations, and it was so wonderfully simple to just drag the animations into the slots :)

    But I'll look into Mecanim then, thanks!
  • @ChrisIceBox I got it to work with mecanim animation. I have 'turn before walking' checked on my character. The turning is of course still fluid in its animation. Is there any easy way to lower the frame rate for that, or would that require custom scripting?
  • It would require custom scripting - unless your character's Motion control setting is set to Manual, AC will turn the character smoothly or instantly according to your given Turn speed, but not incrementally.

    Custom motion contollers are covered in the Manual chapter by the same name, but I don't think that such a script would be necessary.  Instead, I expect that it would be possible to achieve this by moving your model/animation to a child object of your Player's root, and then having a script that snaps the child rotation to a fixed interval based on the root rotation.  That is, your root continues to turn smoothly, but the child snaps every frame to the nearest e.g. 5 degrees via its own Update method.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.