Script changes not applying to prefabs

Hi,

Welcome to our community! :slight_smile:

What you discovered is the normal behaviour in Unity. When you assign a script to the Inspector (of a game object or a prefab), the Inspector takes the initial value from your code but then it controls the component object. This makes sense because if you have different enemies you might want to use different values for them. You assign individual values to their respective Enemy or EnemyHealth component in the Inspector. If you change something in your code, the Inspector is not supposed to override your individual values. Otherwise, you would have to reassign all values each time you change something in your script.

Did this clear it up for you?


See also: