How to (apply ) prefab changes in script ???

alt text

but in script.

thx…

anyOne…Plz

Do you want to change an object derived from a prefab at runtime, then apply the same change to all other clones of the same prefab? I’m almost sure that you can’t do it at runtime, only while in the Editor.

When your game is running, you must do this using brute force: get an array of all objects you want to modify with GameObject.FindGameObjectsWithTag (you must obviously use the same tag in all of them) and apply the changes - something like this:

function ApplyScaleChange(scale: float, tag: String){
    // get all objects with the specified tag
    var gObjects = GameObject.FindGameObjectsWithTag(tag);
    for (var obj in gObjects){ 
        // change the scale of them to (scale, scale, scale)
        obj.transform.localScale = Vector3.one * scale;
    }
}

If there are too many objects, you can place a yield instruction inside the loop - this would make only one object to be modified each frame.