I’m having trouble finding a tutorial on this but would i use Perlin noise or any other noise function to generate a terrain mesh?

Or you could find a texture generated by Perlin Noise look for extension raw and the kind of texture is a terrain heightmap. So then use the terrain editor to generate it for you it is easier than generating yourself the terrain with an algorithm that is already known . Also your terrain wont be different than if I use the terrain editor. Just saying if you want to save some time. Good Luck.

But if you really want to do it , how it works it that the intensity of a pixel(in the texture) is the height ratio of a vertex or a block of vertices. So you would have to do a double for loop and adding a vertices at location [j] and the vertices_[j].position = GetPixel().alpha * 10.0f; Something like that for sure. Once the mesh is done you must save it as an asset. Using SaveAssets()._
A year or two ago I have done a terain mesh in c++ and it takes time…but the algorithm is easy.

There’s a lot of resources on this on the web. But perlin noise or any other coherent noise function is nothing more than a random number generator that produces values that can be predicted assuming you are using the same parameters, that is why for example minecraft can build the same level for you using just one integer as the seed.

This noise can then be applied to a mesh, typically this would be done along the world Y-axis only. If you want to use the unity Terrain system for a more performant solution that should be possible too; by applying the noise to a heightmap, i’m not sure how you would do this at runtime though. I have a feeling that unity’s terrain system isn’t designed to update its mesh dynamically.

I will leave you with some code from Unity - Scripting API: Mesh

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Update() {
        Mesh mesh = GetComponent<MeshFilter>().mesh;
        Vector3[] vertices = mesh.vertices;
        Vector3[] normals = mesh.normals;
        int i = 0;
        while (i < vertices.Length) {
            vertices <em>+= normals _* Mathf.Sin(Time.time);_</em>

i++;
}
mesh.vertices = vertices;
}
}
this code goes through all vertices in the mesh and extrudes them along the normal of the vertex by a multiplier of Mathf.Sin(). Try swapping that Mathf.Sin() with a Mathf.PerlinNoise(vertices_.x, vertices*.y)*
*If you like the idea of procedurally building your terrain, but the terrain doesn’t need to be built during the runtime of your game. Take a look @ http://www.world-machine.com/*_

World machine is a tool that helps you build terrain with the help of noise nodes and other mathematical functions