Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetBlendShapeWeight(int)

Gets the weight of a blend shape for this renderer.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public float GetBlendShapeWeight(int index)

Parameters

index

The index of the blend shape with the weight you want to get.
Index
must be smaller than the Sprite.blendShapeCount of the sprite attached to this renderer.

Returns

Type

Description

floatThe weight of the blend shape.

Remarks

The weight of a blend shape represents how much the sprite has been blended (or morphed) from its original shape to a target blend shape. The target blend shape is another sprite containing the same topology, but with different vertex positions than the original.
The blend shape weight range includes values between the minimum and the maximum weights defined in the sprite.
Additional Resources: SpriteRenderer.SetBlendShapeWeight.