Position of Vertices not changing.

I imported an Ico Sphere from Blender and want to change the position of some of its vertices. Here’s what I wrote:

[SerializeField]private float m_DeformationMultiplier;
[SerializeField]private float m_HitRange;
[SerializeField]private Vector3[] m_Vertices;
private Mesh m_Mesh;

void Start()
{
	m_Mesh = GetComponent<MeshFilter>().mesh;	
}

public void OnHit(RaycastHit _hit)
{
	Debug.Log("Hit Recieved");
	m_Vertices = m_Mesh.vertices;

	for(int i = 0; i < m_Vertices.Length; i++)
	{
		if(Vector3.Distance(m_Vertices*, _hit.transform.position) < m_HitRange)*
  •   	{* 
    

m_Vertices = m_DeformationMultiplier;
_
}_
_
}_
m_Mesh.vertices = m_Vertices;
_
}*_
The m_Vertices-array is working. I get all the vertices’ positions, but even if I change some values in the inspector they just won’t change on the screen and as soon as OnHit is called they change back to their former value.
Please help me figure this out.

vectors are structs. changing them in the inspector does nothing because it’s a different set of vector3’s.
you would need to alter the array itself, but the vertices accessor of the mesh does not return a reference to the original one, that’s a copy too.
this clears it for the field, you have to go the way of assigning the array back in.
and for the hit method part, I guess none of the vertices meet the if condition, which means it’s getting written back in the same it was read out.

Thank you. I was looking in the absolutely wrong place for errors. The error was that I put
_hit.transform.position instead of _hit.point.