So here I have my code:
var pathScript;
var i;
var j;
function Start(){
pathScript = transform.parent.gameObject.GetComponent(nodecreator);
Debug.Log("I'm born!");
Debug.Log("i = " + i);
Debug.Log("j = " + j);
}
function OnTriggerEnter(other: Collider){
if (other.transform.tag == "wall"){
Debug.Log("Destroy Me");
pathScript.array[i,j] = null;
Destroy(transform.gameObject);
Debug.Log("I'm dead");
}
}
Unity gives me an error
MissingFieldException: UnityEngine.Transform[,].
Boo.Lang.Runtime.DynamicDispatching.SliceDispatcherFactory.ResolveMember ()
Boo.Lang.Runtime.DynamicDispatching.SliceDispatcherFactory.CreateSetter ()
Boo.Lang.Runtime.RuntimeServices.CreateSetSliceDispatcher (System.Object target, System.String name, System.Object[] args)
Boo.Lang.Runtime.RuntimeServices+c__AnonStorey1E.<>m__15 ()
Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
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)
Boo.Lang.Runtime.RuntimeServices.SetSlice (System.Object target, System.String name, System.Object[] args)
Boo.Lang.Runtime.DynamicDispatching.SliceDispatcherFactory+c__AnonStorey13.<>m__6 (System.Object o, System.Object[] arguments)
Boo.Lang.Runtime.RuntimeServices.SetSlice (System.Object target, System.String name, System.Object[] args)
nodeDestroy.OnTriggerEnter (UnityEngine.Collider other) (at Assets/New Scripts/nodeDestroy.js:15)
How can I get this to work?
↧