Search Unity

modifying Blendshapes value from script.

Discussion in 'Scripting' started by MrZeker, Apr 6, 2019.

  1. MrZeker

    MrZeker

    Joined:
    Nov 23, 2018
    Posts:
    227
    Hello im trying to use blendshapes in unity, but im finding hard to realize how it works, because the manual is not very explicit. im trying to modify the value of a blendshape (which originally is 0) . What im trying to do is when i push the button the blendshape become instantly 100, however im not sure how to tell unity which blendshape to use, im trying to use the first one, (which is called "key 1", however im not getting the chance to put any string to call it by name i think).
    Here is the little bit of code i have, it is not working. any help would be greatly appretiated.
    Code (csharp):
    1.  
    2. public void ACTION()
    3.     {
    4.         testMesh.SetBlendShapeWeight(1,100);
    5.     }
    6.