Answer the question
In order to leave comments, you need to log in
How to use GetComponent()?
Does not allow you to use the tag to the fullest.
pastebin.com/sAU0RmN3
Answer the question
In order to leave comments, you need to log in
It's about initialization. Try doing this:
Toggle toggle; // create field
...
void Start() {
toggle = workingDay1.GetComponent();
}
void Update() {
toggle.IsOn = _workingDay1;
}
try to translate the error, it will become clearer immediately
1 - Object was destroyed, but you are trying to access it
2 - Toggle type or space was not found (the reference to it must be specified most likely)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question