Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

SpriteRenderer.GetBlendShapeWeight

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public float GetBlendShapeWeight(int index);

Parameters

Parameter Description
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

float The weight of the blend shape.

Description

Gets the weight of a blend shape for this renderer.

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: SetBlendShapeWeight.