# Matrix Instantiation question

When I run this script, it instantiates a corner object at all of the corners. But it makes 4 of them (at each corner) instead of just one. What should I do?

``````var object : GameObject;
var newVertices : Vector3[];
var newUV : Vector2[];
var newTriangles : int[];
var objects : Transform[];
var corner : GameObject;

var myVerts : Vector3[];

function Start (){
var thisMatrix = transform.localToWorldMatrix;
var vertices = GetComponent.<MeshFilter>().mesh.vertices;
for (vertex in vertices) {
print("mesh1 vertex at " + thisMatrix.MultiplyPoint3x4(vertex) );
var newVert = Instantiate(corner, thisMatrix.MultiplyPoint3x4(vertex), Quaternion.identity);

}
}
``````

A way to solve the problem is to only add an object to each vertex position (simply by testing if the you already instantiated the object at that position):

``````var object : GameObject;
var newVertices : Vector3[];
var newUV : Vector2[];
var newTriangles : int[];
var objects : Transform[];
var corner : GameObject;

var myVerts : Vector3[];

function Start (){
var thisMatrix = transform.localToWorldMatrix;
var vertices = GetComponent.<MeshFilter>().mesh.vertices;
var vset : List = new List();
for (vertex in vertices) {
if (vset.Contains(vertex))
continue;