rend.mesh ? I can't replace mesh

so I used:
rend.sharedMaterial = material[0];
to change between the 5 materials I have so I thought I could use:
rend.sharedMesh = mesh[0]; or something along those lines
but such a command does not exist.
I do not want to program my mesh. I have a mash that I input under: public Mesh
with which command do I change mesh runtime?

There are essentially two types of renderers that render a mesh. Either a MeshRenderer or a SkinnedMeshRenderer. Depening on which one you have the mesh is stored at a different place. The Renderer class itself does not have a mesh at all.

A MeshRenderer does not have a reference to a mesh. This has to be provided by the MeshFilter component which has a mesh and sharedMesh property.

The SkinnedMeshRenderer does actually store the reference to the mesh itself because it actually has to preform the skinning. The SkinnedMeshRenderer only has a sharedMesh propery.

We don’t know what your “rend” variable type is and what actual renderer you use. However if you use a SkinnedMeshRenderer you have to declare your “rend” variable as SkinnedMeshRenderer. If you actually just have an ordinary MeshRenderer, you have to replace your mesh on the MeshFilter component on your gameobject.