How to create a rolling wave

I’m working on creating a rolling wave (looping it so it repeats eventually). I’ve gotten this far and it kind of does what I need but it’s crazy choppy. I’m not certain what’s causing this and/or how to fix it.

var scale = 3.0;
var speed = 1.0;

private var Count;
private var baseHeight : Vector3[ ];

function Update () {
var mesh : Mesh = GetComponent(MeshFilter).mesh;

if (baseHeight == null)
baseHeight = mesh.vertices;

var vertices = new Vector3[baseHeight.Length];
//for (var i=0;i<vertices.Length;i++)
for (var i=0;i<vertices.length;i++)
{
var vertex = baseHeight*;*

  • Count=5- Time.time;*
    _ //if (baseHeight*.x == Count)_
    _
    //{_
    _ // vertex.y += Mathf.Sin(Time.time) * scale;_
    _
    //}_
    if(baseHeight_.x >= Count-1 baseHeight.x <= Count +1)
    {
    vertex.y += Mathf.Sin(Count) * scale+scale;
    }
    else*

    * {
    vertex.y = 0;
    }
    vertices = vertex;
    }
    mesh.vertices = vertices;
    mesh.RecalculateNormals();
    }*

    Any help would be greatly apprecieated._

Well your scale is 3, which means your wave heights are 3x their widths. Which seems like it would be incredibly high for Waves.

Actually 3 is low for right now. The scale is the waveheight. I’m using a 50x50 plane that this script is attached to but usually I’m using up to a 2000x2000 sized plane. Which brings me to another problem, w/o creating planes in 3ds max (which doesn’t allow me to change them on the fly if I need to change speed) I have no way of increasing the fidelity of the plane. I slap one in and bam, 10x10 mesh meaning if I want a 6’ wavelength I have to use a 60x60 plane. This gets annoying. Another poster sent me to a help site but I don’t know if he knew what I meant cause I didn’t find anything that helped. Of course I could’ve just mis understood what to do but I digress.

are you still looking for help on this?