**UVs For GeneratedMesh**
You have to modify the procedure mesh code to use DynamicMeshVertex data rather than just FVector
Then when you cache the vertices the UVs will be included!
Here's the section you need to look at, with my modified code (it wont look the same as what you have currently)
```
FGeneratedMeshSceneProxy(UVictoryMeshComponent* Component)
: FPrimitiveSceneProxy(Component)
, MaterialRelevance(Component->GetMaterialRelevance())
{
// Add each triangle to the vertex/index buffer
for(int TriIdx=0; TriIdx<Component->GeneratedMeshTris.Num(); TriIdx++)
{
FVMeshTri& Tri = Component->GeneratedMeshTris[TriIdx];
IndexBuffer.Indices.Add(
VertexBuffer.Vertices.Add(Tri.Vertex0) //returns new index
);
IndexBuffer.Indices.Add(
VertexBuffer.Vertices.Add(Tri.Vertex1) //returns new index
);
IndexBuffer.Indices.Add(
VertexBuffer.Vertices.Add(Tri.Vertex2) //returns new index
);
}
// Init vertex factory
VertexFactory.Init(&VertexBuffer);
```
I modified my triangle struct to look like this (which is the unit for GeneratedMeshTris)
```
USTRUCT()
struct FVMeshTri
{
GENERATED_USTRUCT_BODY()
FDynamicMeshVertex Vertex0;
FDynamicMeshVertex Vertex1;
FDynamicMeshVertex Vertex2;
FVMeshTri()
{
}
};
```
**DynamicMeshVertex has support for UVs in its TextureCoordinate**
So now pass the entire DynamicMeshVertex into VertexBuffer.Vertices.Add(
and UVs will work correctly!
**I've already proven this in my own project,** resulting in fact that now I can make dynamic UV'ed meshes with collision (thanks Dmacesic!)
https://www.mediafire.com/convkey/e081/27c39zzh11o41z06g.jpg
PS: UPROPERTY() doesnt work with DynamicMeshVertex so I took that out