Programming problem

I want to press key"F" and instantiate a object where is the end of the ray.
But when I run it says 89775-jj.jpg

How can I solve this problem?

using UnityEngine;
using System.Collections;

public class RayTest : MonoBehaviour {
public Transform target;
public GameObject building;

void Update(){  
if (Input.GetKey (KeyCode .F)){
    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
	RaycastHit hitinfo= new RaycastHit(); 
		Physics.Raycast(ray, out hitinfo);
		target.position = hitinfo.point;
		GameObject ww = Instantiate (building ,target.position ,target.rotation ) as GameObject ;

As the error says, your target variable is unassigned; there’s nothing actually in the variable, so you can’t access target.position because you don’t have anything to get the .position from. You can fix this by linking another object’s Transform to target in the inspector, or assigning something to target in your code.