Question about creating Static Mesh variable

I’ve decided (after having too many problems with attempting to recreate my code in BP) that I’m going to stick with C++ coding. It’s much quicker and easier for me than the BP system for most things. However, I’m at a point where I need to be able to create a Static Mesh variable in my C++ class that I can access through the editor and choose from the Static Meshes that are loaded into the system.

I attempted:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Geometry")
    		AStaticMeshActor* FloorMesh;

But when I bring down the drop-down list in the editor, I’ve got nothing, even though the Starter Content is loaded and I should have the “Floor_400x400” available to me.

I’m sure I’m doing this completely wrong. I’ve been searching through the docs, and online, but can’t find any answers to this particular problem, so I’ve just been trying to flub my way to a solution–a strategy that’s not working out this time. Any help would be greatly appreciated.

ALSO, when it comes time to actually do the spawning of the geometry, what is the best way to do it? UWorld::SpawnActor? or is there some other way?

Thanks!

Only actors can be placed in game world and AStaticMeshActor is just dummy actor for UStaticMeshComponent and editor automatically place and setup them when you try to place mesh on level. All assets in Content Browser are UObjects, so they have U prefix, in case of static mesh it is UStaticMesh, when you use as property that it will show you all static mesh assets.

If you want to spawn mesh (and i assume you make that varable that you use to set mesh in editor), Spawn empty AStaticMeshActor and from this varable…

Access static mesh component in that actor, using that call StaticMeshComponent->SetStaticMesh(FloorMesh); to set mesh from that property varable (ofcorse first check if it’s not null, or else you might get crash)

There better way for procedural level generation, called instantiated mesh (looks like i dont remeber exact name, but it sounds something liek that :p), i yet to study that myself so search for it