D
D
Dmitry Korolev2016-08-07 20:46:35
htaccess
Dmitry Korolev, 2016-08-07 20:46:35

How to use GetComponent()?

Does not allow you to use the tag to the fullest.
pastebin.com/sAU0RmN3b0b95e7ef7174175986e541a77f7b226.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Seryozha Pukhov, 2016-08-08
@adressmoeistranici

It's about initialization. Try doing this:
Toggle toggle; // create field
...
void Start() {
toggle = workingDay1.GetComponent();
}
void Update() {
toggle.IsOn = _workingDay1;
}

T
Tsiren Naimanov, 2016-08-07
@ImmortalCAT

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 question

Ask a Question

731 491 924 answers to any question