SpawnActor not working with collision

Do you change any settings elsewhere for this? I’m assuming BuildingFoundation is a UStaticMesh pointer. When I go to run the exact code you listed, the StaticMeshActors will spawn but remain invisible due to being set to Static by default. I added the following line to make them appear after spawning. Do you see this same behavior?

foundation->GetStaticMeshComponent()->SetMobility(EComponentMobility::Movable);