Strange C# warning with Vectors

Hey,

I have created this code:

using UnityEngine;
using System.Collections;

public class Follow : MonoBehaviour {

	Transform target;

	float xAxis = 0.0f;
	float yAxis = 0.0f;
	float zAxis = 0.0f;
	
	// Update is called once per frame
	void Update () 
	{
		//Adjust the position to the target
		transform.position = new Vector3(target.position.x + xAxis, target.position.y + yAxis, target.position.z + zAxis);
	}
}

And I receive the following warning:

Field `Follow.target' is never assigned to, and will always have its default value `null'

What am I doing wrong?

Your Transform target variable is private, no value is ever assigned to it, and you’re using the variable in your Update function, so you get this warning. You need to assign a value to transform before using it.