Hey, I’ve been trying out this example from a previous thread:
// Faces can reference the same vertex more than once. Use this function to get a distinct list of vertex
// indices to work with.
List indices = faces.SelectMany(face => face.distinctIndexes).Distinct().ToList();
// Project only the vertex positions that we care about by passing the indices parameter. The third argument
// determines from what plane positions will be projected.
var projected = Projection.PlanarProject(mesh.positions, indices);
// Get a copy of the textures array, assign the new projected values, then re-apply to the mesh.
var uvs = mesh.textures.ToList();
for (int i = 0, c = indices.Count; i < c; ++i)
uvs[indices_] = projected*;_
mesh.textures = uvs;
_// If you want your changes to UV array to “stick”, the faces need to be flagged as manually unwrapped._
_// Otherwise the face UVs will be recalculated the next time ProBuilderMesh.Refresh is invoked.*_
foreach (var face in faces)
face.manualUV = true;
It does not seem to work…
when I open the probuilder mesh at runtime with the UV editor it’s still marked as auto. Has anything changed from 2019, are there any extra steps I need to take to properly project and mark them as manual UV?
Thank you for the help! ![]()