hi people,
I am creating a procedural terrain system and I used CreateMeshSection() function, game can run once but when I run it twice from the editor it will show up this error.
I have totally no idea why…
Access violation - code c0000005 (first/second chance not available)
UE4Editor_ProceduralMeshComponent!UProceduralMeshComponent::CreateMeshSection() [d:\build\++ue4\sync\engine\plugins\runtime\proceduralmeshcomponent\source\proceduralmeshcomponent\private\proceduralmeshcomponent.cpp:416]
UE4Editor_BlockWorld_9393!<lambda_e3db757078c41f0d22c14bc0a83d0e82>::operator()() [d:\develop\unreal\blockworld\source\blockworld\blockengine\chunkrendertask.cpp:83]
UE4Editor_BlockWorld_9393!TGraphTask<FFunctionGraphTask>::ExecuteTask() [d:\program files\epic games\ue_4.20\engine\source\runtime\core\public\async askgraphinterfaces.h:830]
and the code in the source is:
void UProceduralMeshComponent::CreateMeshSection(int32 SectionIndex, const TArray<FVector>& Vertices, const TArray<int32>& Triangles, const TArray<FVector>& Normals, const TArray<FVector2D>& UV0, const TArray<FVector2D>& UV1, const TArray<FVector2D>& UV2, const TArray<FVector2D>& UV3, const TArray<FColor>& VertexColors, const TArray<FProcMeshTangent>& Tangents, bool bCreateCollision)
{
SCOPE_CYCLE_COUNTER(STAT_ProcMesh_CreateMeshSection);
// Ensure sections array is long enough
if (SectionIndex >= ProcMeshSections.Num()) // <<<< == this line
{
ProcMeshSections.SetNum(SectionIndex + 1, false);
}
...
please help… thank you so so much!!