I have an update function that will check if something is equal to true and if it is equal to true it will run some code but then I want the whole script to be disabled. Please help, thanks!
3 Answers
You should use an enabled field. Try following
gameObject.GetComponent<EmailSender >().enabled = false;