- Home /
HeightMap Problem in my mesh
I dont know what is going on, my heightmap value strech in a custom mesh, but its fine with primitives from unity(Sorry bad english)
CUSTOM MESH and PRIMITIVE MESH!! as u can see, in my custom mesh heightmap goes to left and right, on primitive it goes correctly forward and backward.
Your custom mesh probably differs from the Unity primitive. $$anonymous$$aybe the vertex count is different, or the way the triangles are set up.
i've done some tests, and it's something about my normals, set it to 90 degrees manually and for the cube it worked, but i think it's not the right way to do it
Answer by b1gry4n · Oct 15, 2016 at 02:42 AM
if your custom mesh is stretching/distorting a texture, your UVs are not set up correctly. UVs are a value between 0.0 and 1.0. iterating through your vertices, the uv is:
Vector2(currentX/totalX, currentY/totalY).
If normals are really causing issues, after you create the mesh:
mesh.RecalculateNormals();