Skip to content

format

typescript
Animation.Blend(name, weight, normalized_duration, mode)

class: Animation

description

Blends the current animation with the animation named "name". Other animations are not affected.

parameter

param_nametypedescription
namestringThe name of the animation to blend with.
weightnumberThe weight of the target animation.
normalized_durationnumberThe duration of the blend transition.
modeAnimationPlayModeThe play mode.

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.Blend(clip.name, Math.random(), Math.random(), AnimationPlayMode.StopAll);