Question by
insomniacKoala · Nov 18, 2015 at 12:50 AM ·
rotationmovementmeshverticesmeshfilter
Object's mesh does not move/rotate when object moves/rotates
In my scene, I have a regular cube object with a the Mesh Renderer, Mesh Collider, and Cube (Mesh Filter) components. In a script, I call that cube 'rotatedObj' and store its mesh's vertices in an array like this:
Vector3[] verts = rotatedObj.GetComponent ().mesh.vertices;
The problem is this: Even though the object is at (0,0,5), the object's mesh's vertices are centered around (0,0,0). verts[0] = (0.5,-0.5,0.5), verts[1] = (-0.5,-0.5,0.5), etc. It's as if the mesh is a separate entity at the origin, which I can only move by modifying every vertex manually.
Comment