I’m trying to simply bend a cylinder in C#. The only way I can see to do this is to use mesh vertices.
void Update () {
Mesh cyl = GetComponent<MeshFilter> ().mesh;
Vector3[] vertices = cyl.vertices;
int i = 0;
Debug.Log (vertices.Length);
while(i < vertices.Length){
vertices _+= Vector3.up * Time.deltaTime;_
-
i++;*
-
}*
-
cyl.vertices = vertices;*
-
cyl.RecalculateBounds ();*
- }*
Obviously this code moves the cylinder up. I want to bend, but I’m not sure how to select certain vertices and then move them appropriately. Is it even possible to deform the cylinder with this method? If not how can it be done?