|
hi guys... I have a problem whit this exception at this line: var trigger=GameObject.Find("Macchina"); var continua=trigger.GetComponent("GestioneTrigger").cont; I have previously created the script "GestioneTrigger", and inside there is only a boolean variable. My goal is to take the boolean variable from another script but I have this exception.
(comments are locked)
|
|
Try like this: The simple/short answer is, don't use strings in GetComponent ;). That way the compiler can't determine the type that is returned by GetComponent. When using a type, the compiler will return the correct reference type (in your case a GestioneTrigger reference).
Jul 21 '12 at 11:47 AM
Bunny83
thank you so much... now it's corret!
Jul 21 '12 at 12:07 PM
francedema
thank you so much... it's ok!
Jul 21 '12 at 12:09 PM
francedema
Please tick correct answers :)
Jul 21 '12 at 12:10 PM
whydoidoit
(comments are locked)
|
