- Home /
How do I Change cloth.vertices
How do I change cloth.vertices as suggested by the reference documentation. "you are free to transform all cloth vertices manually"
running this code prints a to console the cloth has not move.
cloth.vertices[1] = new Vector3(0,100,0);
Debug.Log ("debug: "+cloth.vertices[1]);
Answer by YoungXi · Jun 19, 2017 at 10:58 AM
Though it has been 3 years... This question got no answer... I was trying same thing too, but apparently it's not possible. Unity cloth has a lot things to deal with before it hands all the vertices from the mesh over to the physics part. Cloth.vertices is the result of the physics simulation, after the physics simulation, there might be a call like this: mesh.vertices = cloth.vertices;(which performs the deformation), and in Unity 5 it is read only.
Instead of thinking about changed the cloth.vertices, what I wanna do is to resetup the cloth based on the deformed mesh at run time. I have that need because my character's body shape can be changed(scaled mostly), and the skinned cloth change with it, well, the vertices that are affected by the physics will always stay in physics. Which is not good fit for dynamic avatar...
Personally, I have found any solution yet. But still, I think its doable.
Your answer
Follow this Question
Related Questions
UnifyWiki BasicQuad 1 Answer
Accessing mesh vertices is extremely inefficient; any workarounds? 0 Answers
How to manipulate(flatten) the Mesh of an object 0 Answers
mesh deformation 1 Answer