# Access mesh vertices on dedicated server package

**URL:** <https://forums.unrealengine.com/t/access-mesh-vertices-on-dedicated-server-package/469623>\
**Category:** Rendering\
**Tags:** vertex, faces, dedicated-server, unreal-engine, question\
**Created:** [August 12, 2020, 9:15am UTC](https://forums.unrealengine.com/t/access-mesh-vertices-on-dedicated-server-package/469623 "2020-08-12T09:15:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_04f32a061](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_04f32a061](https://forums.unrealengine.com/u/anonymous_user_04f32a061)\
**Post date:** [August 12, 2020, 9:15am UTC](https://forums.unrealengine.com/t/access-mesh-vertices-on-dedicated-server-package/469623/1 "2020-08-12T09:15:29Z")

</div>

I want to traverse all triangles of a static mesh:

```
UStaticMeshComponent const* StaticMeshComp;
FPositionVertexBuffer const& vertexBuffer = StaticMeshComp->GetStaticMesh()->RenderData->LODResources[0].VertexBuffers.PositionVertexBuffer;
FIndexArrayView IndexBuffer = StaticMeshComp->GetStaticMesh()->RenderData->LODResources[0].IndexBuffer.GetArrayView();
uint32 const numberTriangles = StaticMeshComp->GetStaticMesh()->RenderData->LODResources[0].GetNumTriangles();

int i, j;
// get vertex j (= 0, 1, 2) of face i (= 0, ..., numberTriangles - 1)
FVector vertex = vertexBuffer.VertexPosition(IndexBuffer[3*i + j]);

```

You have to enable “Allow CPUAccess” on all static meshes that you want to examine this way, otherwise this only works in PIE and not in a packaged build.

But it does not work in a packaged dedicated server (“invalid access”). Interestingly, when I copy-paste the cooked mesh from client package to dedicated-server package, it works. Anyway, I don’t like this dirty workaround.

So, how do you access the vertices and meshes on a dedicated server?

---

<div class="post-metadata">

**Author:** ![PhilSorger](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/philsorger/32/592330_2.png) [@PhilSorger](https://forums.unrealengine.com/u/PhilSorger)\
**Post date:** [October 16, 2020, 8:45pm UTC](https://forums.unrealengine.com/t/access-mesh-vertices-on-dedicated-server-package/469623/2 "2020-10-16T20:45:26Z")

</div>

Also need this answered.

When you say “copy-paste the cooked mesh from client package to dedicated-server package” can you give an example of the file(s) to be copied? How do you know the names of all the files you need to copy?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_04f32a061](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_04f32a061](https://forums.unrealengine.com/u/anonymous_user_04f32a061)\
**Post date:** [October 19, 2020, 1:11pm UTC](https://forums.unrealengine.com/t/access-mesh-vertices-on-dedicated-server-package/469623/3 "2020-10-19T13:11:03Z")

</div>

You have to copy all the files belonging to the mesh where you have enabled “Allow CPUAccess”.  
For example `ClientGameFolder/ProjectName/Content/path/to/SpecificMesh.uexp`.

I am not sure if only the uexp files or also uasset. Just copy all files that are significantly bigger in client version than in the dedicated server version.

---

<div class="post-metadata">

**Author:** ![PhilSorger](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/philsorger/32/592330_2.png) [@PhilSorger](https://forums.unrealengine.com/u/PhilSorger)\
**Post date:** [October 21, 2020, 6:58pm UTC](https://forums.unrealengine.com/t/access-mesh-vertices-on-dedicated-server-package/469623/4 "2020-10-21T18:58:02Z")

</div>

thanks for the reply. that did work and fixes my issue for now…

---

<div class="post-metadata">

**Author:** ![KamikazeXeX](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kamikazexex/32/470517_2.png) [@KamikazeXeX](https://forums.unrealengine.com/u/KamikazeXeX)\
**Post date:** [May 15, 2023, 12:15am UTC](https://forums.unrealengine.com/t/access-mesh-vertices-on-dedicated-server-package/469623/5 "2023-05-15T00:15:58Z")

</div>

Hey, sorry for the bump on an old thread, but did you ever figure out a cleaner solution than just copying the assets/pak file/s over from the client build?
