My script shall provide a text-input-field in inspector to type in a variable-name.
How do I convert this string to a variable I can use in my script afterwards?
My script shall provide a text-input-field in inspector to type in a variable-name.
How do I convert this string to a variable I can use in my script afterwards?
You'll have to use reflection for that:
I recommend restricting the user's input by presenting them with a list of choices, rather than trying to process their raw input. That being said, I don't really know what you're trying to do....
It would be easier for us to help you if you tell us what you're trying to do.
Since you’re using JS, you can use eval(), as long as it’s not a webplayer or iOS/Android.