The following code should move a cube along the z axis when “w” is pressed.
function Update ()
{
if (Input.GetKeyDown ("w"))
{
GameObject.Transform.Translate(0,0,1);
Debug.Log("W");
}
}
The game starts fine but when “w” is pressed I get
" NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) "
Any ideas on what is going wrong?