Please don’t necro post; this thread is over 6 years old and has already been resolved above with code that works/compiles. Your suggestion is wrong and won’t compile. You don’t use “var[ ]” you’d use “var” and “MonoBehavior” is spelt “MonoBehaviour”.
Thanks.