askvity

How do I edit an imported animation in Unity?

Published in Animation Editing 3 mins read

You can't directly edit an imported animation clip in Unity because it's typically read-only. However, you can copy the animation data into a new, editable animation clip. Here's how:

Steps to Edit an Imported Animation

  1. Create a New Animation Clip: In your Unity Project window, right-click in the desired folder, select "Create," and then choose "Animation Clip." Name it something descriptive (e.g., "ModifiedJumpAnimation").

  2. Select the GameObject with the Animator: In your Scene view or Hierarchy, select the GameObject that uses the imported animation.

  3. Open the Animation Window: Go to "Window" -> "Animation" -> "Animation" to open the Animation window.

  4. Assign the New Animation Clip: In the Animation window, click the dropdown menu where the current animation is displayed (it likely shows the name of your imported animation). Select your newly created animation clip ("ModifiedJumpAnimation") from the menu, or if it's not listed, choose "Create New Clip" and then select the new clip you just created.

  5. Select the Imported Animation: In the Project window, find the imported animation clip you want to edit. Select it.

  6. Copy Animation Data: In the Animation window (with the imported animation clip selected in the Project view), select all the keyframes you wish to copy. You can typically do this by clicking in the left-most column to select all properties and their keyframes for the entire timeline. Then press Ctrl + C (Windows) or Cmd + C (Mac) to copy.

  7. Paste Animation Data: Now, in the Animation window (with your new animation clip selected), click on the timeline at the position you want to paste the animation data (usually time 0:00). Then press Ctrl + V (Windows) or Cmd + V (Mac) to paste.

  8. Edit the New Animation Clip: You can now modify the keyframes in your new animation clip. You can move keyframes, change their values, add new keyframes, or delete existing ones. The imported animation remains unchanged.

Important Considerations

  • Original Animation Remains Unchanged: This method creates a copy of the animation data. The original imported animation remains untouched. This is crucial for maintaining the integrity of your imported assets.

  • Animation Events: Animation events are not directly copied when using this method. You will need to manually recreate any animation events that you want to use in your new animation clip.

  • Referencing the New Animation: Make sure that the Animator Controller for your GameObject now references the new animation clip instead of the original imported clip. This is done by dragging the new clip to the appropriate state in the Animator window.

  • Additive Layers: For more complex editing or animation blending, consider using Animation Layers and Animation Masks within the Animator Controller. This allows you to additively layer animations on top of each other without directly modifying the base animation.

Related Articles