Self coded plane vs Unity plane

Update 22.07

Code below works fine when you add it to Unity objects like plane, cube etc but when i add this code to empty game object and delete 1st line(GameObject road…) i got error
“Object reference not set to an instance of an object” in line 31
why ?

	void Start()
	{
		
		GameObject road = new GameObject("road", typeof(MeshFilter), typeof(MeshRenderer));
		
		MeshFilter mesh_filter = GetComponent<MeshFilter>();
		MeshRenderer mesh_renderer = GetComponent<MeshRenderer>();
				
		Vector3[] square = new Vector3[4];
		
		square[0] = new Vector3(0,0,0);
		square[1] = new Vector3(1,0,0);
		square[2] = new Vector3(0,0,1);
		square[3] = new Vector3(1,0,1);
				
		int[] tri = new int[6];
		
		tri[0] = 0;
		tri[1] = 2;
		tri[2] = 1;
		
		tri[3] = 2;
		tri[4] = 3;
		tri[5] = 1;

		Mesh mesh = new Mesh();
						
		mesh.vertices = square;
        mesh.triangles = tri;
		
		mesh_filter.mesh = mesh;
		
	}
}

Original question

Hi there i coded plane/square from two triangles
The problem is square don’t recognize raycasting(another object moving on this square when mouse click);

but when i put plane from “GameObject > Create Other > Plane” and add the same raycasting script everything is alright.

How can i get same effect on my self drawed square ?

using UnityEngine;
using System.Collections;

public class PathF : MonoBehaviour {
	
	void Start()
	{
		Mesh mesh = new Mesh();
		
		Vector3[] square = new Vector3[4];
		
		square[0] = new Vector3(0,0,0);
		square[1] = new Vector3(100,0,0);
		square[2] = new Vector3(0,0,100);
		square[3] = new Vector3(100,0,100);
				
		int[] tri = new int[6];
		
		tri[0] = 0;
		tri[1] = 2;
		tri[2] = 1;
		
		tri[3] = 2;
		tri[4] = 3;
		tri[5] = 1;
		
		Vector2[] uv = new Vector2[4];

	    uv[0] = new Vector2(0, 0);
	    uv[1] = new Vector2(1, 0);
	    uv[2] = new Vector2(0, 1);
	    uv[3] = new Vector2(1, 1);
		
	    Vector3[] normals = new Vector3[4];

	    normals[0] = -Vector3.forward;
	    normals[1] = -Vector3.forward;
	    normals[2] = -Vector3.forward;
	    normals[3] = -Vector3.forward;
				
		mesh.vertices = square;
        mesh.triangles = tri;
		mesh.uv = uv;
		mesh.normals = normals;
 
        gameObject.AddComponent<MeshRenderer>();
        gameObject.AddComponent<MeshFilter>().mesh=mesh;
		
	}
}

Perhaps you need to include a mesh collider on your self drawn plane?