- Home /
This question was
closed Apr 20, 2020 at 11:22 PM by
JEL92.
How can I return bool statment from another script back to false after coroutine is complete? WaitForSeconds does not seem to work.
IEnumerator "MyCoroutine"() {
other.GetComponent<"script name">().isActive = true;
yield return new WaitForSeconds(5f);
other.GetComponent<"script name">().isActive = false;
}
Comment
Answer by yummy81 · Apr 18, 2020 at 08:20 PM
change "isActive" to "enabled"
$$anonymous$$y bool is called isActive. ex. public bool isActive = false; Changing it to enabled did not fix the issue. Thanks for your help though. I appreciate it. @yummy81
Did you remember to attach the object to the variable in Unity?
Also, you can see if there is anything in the object's script changing its value
Tell me if this helped