Skip to content

format

typescript
Animation.RemoveClipByName(name)

class: Animation

description

Remove an animation clip based on its name.

If an animation clip with the name "name" exists, it will be removed from the Animation component.

parameter

param_nametypedescription
namestringThe name of the animation clip to remove.

reture

typedescription
void

code example

typescript
let obj = new GameObject();
let animation = obj.AddComponent<Animation>(Animation);
let uuid = "31A9092E126B4B19BBFD9D5FCD75AA49";
let clip = Resources.Load<AnimationClip>(AnimationClip, uuid);
animation.AddClip(clip,"newClip");
animation.RemoveClipByName(clip.name);