How to create an .anim file from a .fbx file?

Hi, I am new in using Unity. In my game, models and animations are exported from 3DMAX as .fbx files, animations are clipped in Unity, but there’s no .anim files generated, I need separated .anim files because the following code will not work even I have clipped animation “run”:

var clip = animation[“run”];

Can someone help me? thanks in advance.

In the Project view, expand the foldout for the FBX model. You’ll see individual animation clips with gray play-button icons. Click on one of these clips and press Option-D (or Ctrl-D in Windows) to duplicate the clip as an .anim file.

To use the code in your answer, make sure “run” is in the animations list on your character’s Animation component.

how do you do this the other way around i want my anim to be a fbx file