Uncheck Script

Hey All,
I have 2 scripts on an object of mine. One of the scripts is the script that allows for user control, the other is an AI script. Pretty much what i want to have happen is if the player selects that object in the menu, it will “uncheck” the AI script (assuming originally both the user control and AI control are checked) and the player control script will still be checked.
I have tried this:

var AI : ObjectAI; //(ObjectAI is the name of the AI script)
function Start(){
AI.enabled = false;
}

but that doesnt seem to work… both seem to still be checked off. Any ideas?

use

AI.active = false

worked perfectly! Thank you very much!

hmm so that works but now I am having a problem where it will disable the other scripts as well. I have 3 scripts on the plane. I just want that AI script to be inactive which works but it deactivates the user control code

.active is not a property on a Behaviour. It is a property of the Game Object. You need to figure out why .enabled wasn’t working.