Instantiating prefab with C#, playing blend shapes, but all play the blend shapes at the same time,

This is the main code I use to instantiate a prefab. I have an empty w/ a box shape attached to it. The prefab is linked from the project explorer (i.e.-drag/dropped into the GameObject public variable),

Prefab instantiate code,

public void SpawnPrefab()
    {
        Vector3 position = new Vector3(Random.Range(collider.bounds.min.x,collider.bounds.max.x),
                                       Random.Range(collider.bounds.min.y,collider.bounds.max.y),
                                       Random.Range(collider.bounds.min.z,collider.bounds.max.z));


        GameObject theObject = (GameObject)Instantiate(prefab, position, Quaternion.identity);
}

On another gameobject/script, I play a blend animation with this code,

skinnedMeshRenderer.SetBlendShapeWeight(blendStateIndex, blendShapeAmount);

The problem is, once I do this, no matter how many prefab clones I have, if I raycast/hit one object, the blend shape plays on ALL of the clones, though I only want it to play on one.
Do I need to instantiate the mesh alone or something?

Hmmm, it seems that it’s not the blend shape, but the script (changing a variable in a script on a prefab clone changes them ALL :frowning: ). So I guess, on that note, how do I ensure when I instantiate a prefab multiple times, the script running is unique to each instance?

Any info would be appreciated.

Chirp, chirp :smile: