Crash when creating a new level

hi,

This code :

FName baseName = FName(*string);

level = NewNamedObject<ULevel>(world, baseName, EObjectFlags::RF_NoFlags, (UObject *)& gameInstance->TemplateLevelSolarSystem);

crash the editor here in “engine/source/runtime/core/public/uobject/nametypes.h” :

  306    	ElementType const* const* GetItemPtr(int32 Index) const
  307    	{
  308    		int32 ChunkIndex = Index / ElementsPerChunk;
  309    		int32 WithinChunkIndex = Index % ElementsPerChunk;
  310    		check(IsValidIndex(Index) && ChunkIndex < NumChunks && Index < MaxTotalElements);
  311 *****     ElementType** Chunk = Chunks[ChunkIndex];
  312       	check(Chunk);
  313       	return Chunk + WithinChunkIndex;
  314       }
  315       

It’s about a FName problem, but what ?

Just curious but why would you create a new level that way?

I create all levels on the fly. It’s a procedural world.

Hello w77,

In the process of having a procedural world, I would suggest already having the level created as a .umap asset but populating it with assets in a procedural manner. Attempting to create assets in such a way at runtime is always risky.

We haven’t heard from you in a while w77. Are you still experiencing this problem or have to worked around it in some way? Please let us know any progress you’ve made. In the meantime, I’ll be marking the issue as resolved for tracking purposes.