- Home /
Script reads the same variables
I know - I create this question day ago, but I want to ask you about something a little different. I have simple example:
var example : boolean;
function Start(){
yield WaitForSeconds(4);
example=true;
}
I have two objects, and this script is included to these two objects. When I off one of them and the other one is still working, "example" and so is equal to true, despite the fact that is off... So these scripts read their variables. How to "disconnect" common script?
Sorry, but i don't get the question. The enabled state of your scripts is just "another variable" of your script. If it's false Unity won'd call Update on them. As long as the instance of the script is attached to the object it will keep it's variables. I don't get what you want to achieve.
Your answer
Follow this Question
Related Questions
Updating variable on another script. It is not working. 2 Answers
accessing a variable from another script. 3 Answers
Unity thinks my animation is not attached, but it is. 2 Answers
Script with variable number of variables ? 1 Answer
Unity setting SerializedProperty.prefabOverride incorrectly 2 Answers