Hi,
I'm trying to create bumps on my mesh. To do so, I have to tell every vertex of my mesh to change its "y" value. It worked fine, when I had one mesh. The problem started when I created chunks. So now I have few meshes and I need to get their world space coordinates. I read about it and used transform.TransformPoint(), but it doesn't work and I have no idea why. I spent hours on figuring out why it doesn't work and still I have no clue. This is what I got so far:
Vector3 test = transform.FindChild("2").GetComponent().mesh.vertices[1];
test += transform.TransformPoint(test);
test.y += 5;
transform.FindChild("2").GetComponent().mesh.vertices[1] = test;
print(transform.FindChild("2").GetComponent().mesh.vertices[1]);
Child called "2" is my second chunk. I have its vertices, but when I modify its "y" nothing happens.
↧