Moving a sphere's vertices outward

I have a sphere. I need a way to move some of its vertices outwards by a fixed amount. I’m having a problem figuring out how to do this. This embarrasses me.

At the moment, for each vertex, I’m doing this:

vertices[i] += vertices[i] * Time.deltaTime / flatness;

This is not ideal since the amount that each vertex is moved by is not fixed (vertices farther from the center of the sphere are moved Farther). I would like a way for each vertex to be moved outwards a fixed amount, no matter how far out it currently is.

I know, I know, I should have studied calculus in high school… :sweat_smile:

Try this:

var amount = 0.3;

function Start ()
{
	var mesh = GetComponent (MeshFilter).mesh;
	var vertices = mesh.vertices;
	var normals = mesh.normals;
	for (var i = 0; i < vertices.Length; ++i)
		vertices [i] += mesh.normals [i] * amount;
	
	mesh.vertices = vertices;
}

Holy smokes, that did the trick! Thanks so much, Daniel!