How can i put some mesh with c++?

Hi i need to put different kind of mesh in a map at specific location with c++.

I saw some tutorial but they make only a blank mesh that is usless or make some triangle that is usless too.

Hi have to take some 3d object that already exist and put somewhere with an algorithm.

I won’t use blueprint, because i want to make a wave function collapse algorithm and if use blueprint i presume that all will be slow.

So i need to know how i can take a single or many 3d object in the scene at specific coordinate that i will make with an algorithm that i’ll make later, but for now i really need how i put some object in the scene.

I’m already going crazy just figuring out how to insert a cube!

Hi,

based upon this thread https://forums.unrealengine.com/t/load-static-mesh-with-path-in-c/292234/2 you should be able to do something like this to load existing meshes through c++

TSubobject<UStaticMeshComponent> mesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("Mesh"));
const ConstructorHelpers::FObjectFinder<UStaticMesh> MeshObj(TEXT("/Game/Mesh/Cube/YourMesh"));
mesh->SetStaticMesh(MeshObj.Object);