merge vertices at runtime?

is it possible to merge vertices at runtime? I'm aware of stitchscape, however, I'm not trying to merge terrain segments.

I have a preset number of tiles for an environment, that after the script I have chooses which ones to place, I would then like the ability to merge the verts at each face/side of each tile to get one seamless mesh WITH MERGED VERTICES(not the combineChildren method that just combines meshes).

Is anyone aware of how, or if this is possible in unity AT RUNTIME?

Sure, but you'll need to do it yourself.

Take a look at the Mesh class.

It will work something like this

  1. Get all meshes you want to combine
  2. Extract relevant mesh data (verts, normals, UVs whatever)
  3. Combine mesh data into new arrays
  4. Loop through combined verts, and check to see if any overlap
  5. Flag overlapping verts and remove them from all arrays, in the case of triangles, you'll have to be careful.

This certainly isn't easy, and depending on your requirements, there are quite a few different ways of doing this.

In a case where I needed to merge verts before, I trimmed all the float values of the vertices, and added them to a dictionary, keyed on vertex position, and set to return the index. That way, when overlapping verts were added, the old verts were overwritten. You could then look up into the dictionary based on position to retrieve the index. Again, there is a fair amount of complexity there which I'm skimming over, but hopefully you get the idea.