system
1
//This creates a variable which must be assigned to an object with a Controller attached.
var myController : CharacterController;
//This variable must take a GameObject with a Transform Component - almost anything
var myGenericObject : Transform;
//This variable looks for an object with an instance of a script attached - this one to be precise.
var myTestObject : ComponentTest;
Hm… I’m not good with c#, but I think this should work:
public CharacterController myController;
public Transform myGenericObject;
public ComponentTest myTestObject;
not sure if ComponentTest needs to be ComponentTest.cs or can be ComponentTest.js though… but if it’s .js it needs to compile first.
Further reading: