i'm making a showroom, and the object i'm showing is rotating due to a script i wrote...now i want to be able to toggle this script on and off by pressing R on the keyboard...this is what i got so far
If the script is disabled, then Update (which presumably is where this code is) isn't running, so naturally it can't reenable itself. You'd want to enable/disable it from another script. (As an aside, better to not use strings with GetComponent...slower and not type-safe.)