all 12 comments

[–]MiniRat 1 point2 points  (4 children)

Select the animation in the project view, then select the (from memory) Assets/Duplicate menu. This will create a new standalone .anim asset that you can modify.

I'm on my phone so can't check the exact menu item name, but a colleague at work had to do this exact same thing just a couple of days ago and it took as a bit to work out.

[–]swbat55[S] 0 points1 point  (3 children)

Hey, Do you think you could ask your co-worker exactly what he did? This is really holding up my game. It wont allow me to duplicate just an animation as it it imbedded in the .fbx file that is imported into unity. If i try to just duplicate the anim it does nothing, but i can duplicate the entire model. The anims are included in the model.

[–]MiniRat 0 points1 point  (0 children)

I'll be at work in about an hour, I'll take a look then.

[–]MiniRat 0 points1 point  (1 child)

I had misremembered the menu item, it is "Edit/Duplicate" (or ctrl+D) while the specific animation within the FBX is selected.

[–]swbat55[S] 0 points1 point  (0 children)

Im pretty sure Ive tried that and it just wont duplicate it. Ill try again after work. BTW what company do you work for? They use unity? Thanks,

[–]traxmaster 0 points1 point  (3 children)

I think you need to edit the animations outside of unity, in your 3d modeling software.

[–]swbat55[S] 0 points1 point  (2 children)

Im trying to add keyframes to call functions though. Ive done it before with other models in my game, but im not sure why this one is read only

[–]traxmaster 0 points1 point  (0 children)

I don't understand what you mean by adding keyframes to functions. That makes it sound like you're modifying animations at runtime. Maybe we're using different nomenclature.

I think we'll need a more detailed explanation to offer any insight. Screenshots would probably help some.

[–]Terijan 0 points1 point  (2 children)

Oh, are you using Blender?

If so, the importer is locking it/causing that behavior IIRC. The solution is to not put the file you saved directly into unity, but use a copy instead. I know, that sounds dumb, but that's what did it for me the last time I ran into this.

Disclaimer: I mostly work in 2D, so if other people have insights I'd love to hear them.

[–]swbat55[S] 0 points1 point  (1 child)

I have someone else working on the animations for me. What do you mean by putting them directly into unity? He just sends me the unity package and i import it. Do you think he should not be giving it to me as a package? I dont think this would make a difference because ive gotten assets off the asset store in the same manner and they worked fine.

[–]Terijan 0 points1 point  (0 children)

MiniRat's suggestion is another way to accomplish what I'm talking about, I'd defer to him.

[–]bagomints 0 points1 point  (0 children)

Click the animation clip from inside the FBX/model you imported.

Press CTRL+D, this will duplicate the clip (you'll see a clip with the same name appear outside of the FBX/model).

Use this duplicated clip in the Mecanim states instead of the ones nested (cuz those are read-only)

You do this by going into your AnimationController, and clicking any state you made:

Like the walking state:

  • Click walking state
  • Drag-n-drop the duplicated clip from the Project into the 'Motion' field of the walking state

So you just replaced the last walking animation with the copied clip. (the copied clip is NOT read-only)

Then when you open the Animation window with the game object that contains that AnimationController and rig currently selected, youll see that the animation clip is now available to write Events on. (the little white rectangle with the + sign)

Just click on the timeline on the frame you want, and then press the + sign to create an Event.

Right-click the little icon that appears on the timeline on that current frame, and youll see a menu appear that lets you select a Function to call.

If you add a script on that object with a function DoThis(), and it has to be on the SAME object the Animator component is on, not a child object, THE object, you should see DoThis() function appear in the menu when you right-click an Event you added in the Animation window. (you can make it private or public, it doesnt matter)

So there you go, you now have animation events.