problem with PlayerController script

I have problem with PlayerController script in unity course “Week 3: Basic Gameplay” My variable x_Range don’t change value in unity, i dont now why, i save script but old value is still in unity Inspector of player object.

You should change the value in the inspector (on the right) and not in the script !

Changing the value in the script will only change it’s default value, the one that will be use when you initially add the component.

Exactly this. Once you have added the component, Unity serializes the value in that field upon save (either in scene or prefab) and ignores the default in code.

A better way than assigning constructor-time values is to implement the void Reset() method in your MonoBehavior, so it is obvious when that code is run. You can run that code from the hamburger in the upper right corner of the inspector panel for that component.