Search code examples
unity-game-engineblender

Bezier circle animation export


I was using blender to make a snake movement animation for my game I have an animation. but when I use the Bezier's path I am not able to export the same animation into unity. enter image description here


Solution

  • To make an object follow the curve you can use the Follow Path blender follow path

    after adding the Curve to Target you can click Animate Path, now the path is animated for the path, but there are no key frames, therefore go to Object->Animation->Bake Action

    Bake action

    now the Keyframes are set. If you already setup the animation and have all the Keyframes you need you can export the file as FBX. To make sure everything is set up correctly change the following settings while exporting:

    Exporting settings

    In the picture i changed following settings:

    Include:

    • Selected Object Enable
    • Object Type -> Armature, Mesh (if you need more add them)

    Transform:

    • Forward-> Z Forward (otherwise you have to rotate objects inside Unity)

    Geometry:

    • Apply Modifier (if you don't have any you can disable that) Armature:
    • Add Leaf Bones Disable (you don't need them and they only take space)

    Animation:

    • NLA Strips Disable
    • Force Start/End Keying (can do but don't need to)

    if you import the FBX you can click the Object and look on the inspector under Animation, animations should be listed there

    Animations

    Edit:

    If you keyed your object and there is no animation the problem is most likely that you keyed the wrong paramters. For example if you use tools like follow path and try to key the position the object has it will not export the keyframes because the position of the object never changed, since the position is not calculated with the position but the offset on the curve.