what do i do when this happens?

NullReferenceException: Object reference not set to an instance of an object
UnityStandardAssets.Vehicles.Car.CarController.Move (Single steering, Single accel, Single footbrake, Single handbrake) (at Assets/Standard Assets/Vehicles/Car/Scripts/CarController.cs:135)
UnityStandardAssets.Vehicles.Car.CarUserControl.FixedUpdate () (at Assets/Standard Assets/Vehicles/Car/Scripts/CarUserControl.cs:27)

It says the CarController needs an instance. I can't really explain better than that. If you show your code, someone can point out what to do. NullReferenceException is very common error. [http://answers.unity3d.com/search.html?f=&type=question&redirect=search%2Fsearch&sort=relevance&q=null+reference][1] [1]: http://answers.unity3d.com/search.html?f=&type=question&redirect=search%2Fsearch&sort=relevance&q=null+reference

2 Answers

2

Hello and good day, let’s begin with the null reference, this happens when there is no object, field or variable that you have defined the class, component or game object within the code, the same debugger indicates which is the line to check for that context, I recommend that you verify and you make sure whether you need to create a prior reference to their use, sometimes you have to use something like this:

MyClass variableClass =  new MyClass();
//or something like this
RiggidBody riggid = gameObject.GetComponent<RiggidBody>();

Could be any type: Transform, Collider, Mesh, etc.

Check the documentation for more references, cheers. dO.o

not very helpful, as I stated earlier I already check the variables and the syntax

Thanks alot