Weird ass Boo error

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)
Boo.Lang.Runtime.RuntimeServices.Invoke (System.Object target, System.String name, System.Object args)
UnityScript.Lang.UnityRuntimeServices.Invoke (System.Object target, System.String name, System.Object args, System.Type scriptBaseType)
AISimple.Update () (at Assets/Tutorial 5/Tutorial 5/AISimple.js:11)

what does this all mean ? I don’t speak gobboldy gook ? Heres the script if it helps

var Distance;
var Target : GameObject;
var lookAtDistance = 1000;
var moveSpeed = 2;
var step = moveSpeed * Time.deltaTime;

function Update ()
{

	
	transform.Translate.Vector3.MoveTowards(transform.position , Target.position , step );

}

Remember to post comments as actual comments and not answers (I have converted this one for you).

–

@Souk21 Sure. So basically I have a crate object. It has a 2D box collider and a Rigidbody 2D. If I place that object next to a wall that consists of multiple sprites with box colliders, it randomly gets stuck on the wall. This also happens when I have some kind of conveyor belt. It is basically a script that applies force to a rigidbody object. While the object is moving it gets stuck. I hope that explains it better!

–

2 Answers

2

Well you better start learning to read errors like this, as that is key to being able to debug your own code. You have a NullReferenceException, which means one of your variables is null when it shouldn’t be. Are you sure Target is being set in the inspector?

Definetly set

–

That’s because the code you’ve written is JavaScript, not Boo…

As it looks like you’re copying this from a tutorial, I think what you meant to do was Create → Javascript :slight_smile:
If you actually meant Create → Boo then I suggest you write your code in Boo.