When I import animations from Maya, I bake all the keys for all objects and save the file to Maya Binary format, but I get lots of problems when I play the animations, f.e if I do animation with replacing technique , like replacing the mouth in one frame when I play the animation in Unity the animation will play some inbetween frame that shows the mouth dislocated. I guess this is because Unity is playing the animation based on time and not on frame, but is there a way to make it Snap to a frame?
In Maya, the way to achieve this is to make all keys Stepped which means no interpolation between frames all transformation remain static until next keyframe is reached. but Unity (at least Unity iPhone) does not recognize this kind of interpolation.
Answer by runevision
Oct 27, 2009 at 05:18 AM
If you want to only sample an animation at times that are snapped to frames, you must manually set the time of the AnimationState of the relevant clip in the Update function. In order to snap to frame x, set the time to x / frameRate. You can get the framerate from the AnimationClip.
Been looking for this too, amazing!
Answer by awesomedata
May 20, 2016 at 08:51 PM
@runevision Could you give some example code? Not sure I'm following, especially if I might want it to be on the same frame on every client in a multiplayer game...
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
3 People are following this question.
Animation importing issues from maya
Maya Import Problems
Is importing from Maya via fbx using model@anim broken?
Import character with gun animation
Maya import into Unity, pivot off center