i have to scripts and the first one neads to get a variable value from the second however although the value i want is public it dosent get it it comes up null if i print it and i dont have a clue why
any help is aprichiated
asked May 09 '11 at 05:53 PM
It's the good old casting problem. GetComponent returns a reference of type Component. You either have to cast it explicit or implicit into the right type.
I actually don't understand why you use an array of Transform when you just want to access your score script.
That way it's faster and much more reliable. It's the straight forward way: