UStaticMeshComponents in my Actor blueprint are null, but only in Standalone play.

I have this very simple (for now) class that represents a building block for my procedural levels. It’s the base class for my blueprints:


UCLASS()
class ROBOTSHOOTER_API ALevelBlockActor : public AActor
{
	GENERATED_UCLASS_BODY()

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = LevelBlock)
	TSubobjectPtr<UStaticMeshComponent> LevelGeometry;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = LevelBlock)
	TSubobjectPtr<UStaticMeshComponent> StartPoints[4];
};


In the constructor, I initialize the StartPoints like this:


	for (int i = 0;i<4;i++)
	{
		FString name = FString::Printf(TEXT("StartPoint_%d"), i);

		StartPoints* = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, FName(*name));

		StartPoints*->AlwaysLoadOnClient = true;
		StartPoints*->AlwaysLoadOnServer = true;
		StartPoints*->bHiddenInGame = true;

		StartPoints*->AttachParent = RootComponent;
	}


In the editor, this works fine. I generate my level, find my actor with the starting blocks in it, and then spawn my player where the starting block is. (Let’s not get into a discussion about why I am not using PlayerStart objects.) This is some ugly hackery until I find a nicer way to put this data in the blueprint.

However, in standalone mode, the player spawn fails because it can’t find any start points.


	ALevelBlockActor *blockActor = level->StartingBlock->getInstancedBlock();

	check(blockActor!=nullptr);

	// TODO: Do something smart with locations

	check(blockActor->bActorInitialized==true);

	UStaticMeshComponent *meshComponent = blockActor->StartPoints[0].Get();

        /*** This assertion will fail. None of the start points should ever be null. ***/
	check(meshComponent!=nullptr);


Not sure why this happens. Obviously there’s some editor only functionality here that I am unaware of.

The blueprint that is the level block is just an instance of the LevelBlockActor with the level geometry assigned, and one of the 4 start points has a mesh in it. Even if there’s no mesh assigned, the component itself should never be null.

Any ideas? I can’t even debug this since it only happens in standalone mode.