- Home /
rotating vertices with for loop in
Hi Everyone,
I have some code that allows my vertices of my mesh to be rotated but I would like to know how I could get it to rotate constantly and smoothly like a spinning object, as the code at the moment just rotates the vertices to the desired angle.
void RotateMesh (){ Quaternion qAngle = Quaternion.AngleAxis( rotatedAngleY, Vector3.up ); for (int vert = 0; vert < originalVerts.length; vert ++) { rotatedVerts[vert] = qAngle * originalVerts[vert]; }
theMesh.vertices = rotatedVerts;
}
transform.Rotate (Vector3.up, rotationSpeed * Time.deltaTime,Space.Self); so that it would look similar to this however only the mesh would be rotating.
Thanks in advance
Your answer
![](https://koobas.hobune.stream/wayback/20220612190225im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Changing Y Value in Vertex Array? 1 Answer
Error use of unassigned local variable 2 Answers
How to save a 2d-array in C# 2 Answers
Sorting Javascript array by Distance 0 Answers
Making an Array of Animations Play at Random With No Repeats 3 Answers