Hi,
When exactly did you set the moveSpeed value to 10? If you did that after you assigned your script (with the variable) to the Inspector, the Inspector gets control over the component. The default value of an exposed variable in your code is only relevant at the moment when you attach the script to an Inspector. The Inspector uses that default value as the initial value but won’t change it anymore just because the script got modified.
This behaviour makes sense because, otherwise, it might be that you spend hours fine-tuning values in the Inspector for multiple game objects which have the same script component attached, and after you changed something in the script component, all values would get reset to the initial values. That would be a nightmare because you would have to fine-tune everything again—each time you make a change in the script.
Did this help?
See also:
- Forum User Guides : How to mark a topic as solved