Get random point on mesh code problem

I am trying to follow the code from here Get Random Point In Mesh?

but the line:

&TheSMA->StaticMeshComponent->StaticMesh->RenderData->LODResources[0].PositionVertexBuffer;

keeps giving me the error
error C2248: ‘AStaticMeshActor::StaticMeshComponent’: cannot access private member declared in class ‘AStaticMeshActor’

I am unsure how to fix the error.

Hi there @peanut13th, hope you’re well!

This topic has been moved from International to Programming & Scripting: C++.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Thanks and happy developing! :slight_smile:

I have no idea about the code, but just from the error message:

If it is an object that comes with UE: It sounds like you have to use a “Getxyz()” function for whatever variable you are trying to access instead of just getting it directly.

If it is your own created code: You probably put something in private that you should make public or create a getter for.