I have a problem in runtime...

i keep getting this error... does anyone know what it means?

"NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
Boo.Lang.Runtime.RuntimeServices.GetProperty (System.Object target, System.String name)
UnityScript.Lang.UnityRuntimeServices.GetProperty (System.Object target, System.String name)
shoot.Update () (at Assets/Enemy Soldier/shoot.js:11)"

its when i run this code it says boo.lang.Runtime error, but the code is javasript...

//Based off of MECH WARRIOR hit miss system.

var instantiatedEnemy : GameObject;//object GUI is attached to var enemyInRange : boolean;//range var enemyHealth : GameObject;//the instantiated object (leave blank) var accuracy : int;//the accuracy. var randomNumber : int;//random number enemyInRange = false; function Update () { //shoot if in range if(enemyInRange){ enemyHealth = instantiatedEnemy.GetComponent("Soldier Button GUI").cloneSoldier;//i know this is the problem...// randomNumber = Random.Range(3,18); if((accuracy + randomNumber) > enemyHealth.GetComponent("Ally Health").defence){ enemyHealth.GetComponent("Ally Health").Health -= 5;//and this once that works...// } } }

Given:

at Assets/Enemy Soldier/shoot.js:11

I would say that either instantiatedEnemy is null OR there is no component on that called "Soldier Button GUI". I think I would go with the latter, this is presumably the name of a Monobehaviour on the instantiated enemy and it has spaces in it. Normally (as far as I know) components have to adhere to the standard class name conventions. So SoldierButtonGui would be the name of a class you have written and put onto the enemy. When you fix that you likely will get a cast exception because MonoBehaviours are not GameObjects.