Edit script while playing?

Hello! I have a script for mouselook and I want the player to be able to change the sensitivity in an options menu. It’s the script from here. Is there any way I could do it?

Thanks!

In short: yes
In long: there isn’t an easy way. You’ll have to do it yourself, as option screens are game-specific, as are config files.

I’ll reccomend the configparser module for handling saving player settings.
If you want more help, tell us whatyou’ve done already, how you’ve tried to do it, and then I’ll help if I can

I’ll get back to you then.

I could be wrong but couldn’t you just make the sensitivity a property instead of a hardcoded number? I’m not sure since that script looks rather advanced, but like instead of sensitivity = 2 it could be something like sensitivity = player[“sensitivity”].

I’d believe to change the property all you would need is to have an overlay scene or a new scene that is your option window and have like buttons that have a mouse over and a mouse click sensor and one lowers by 1,one raises by 1, and maybe if you’d like a default settings that would set it back to the original?

This script already uses properties to adjust mouse sensitivity, using the property actuator you can change that number in a variety of ways.

Interesting. I’ll try that.

yeah properties or global dictionary are your gotos for saving and recalling anything.