USplineComponent not being created in stand alone game


	UPROPERTY(VisibleDefaultsOnly, Category = Spline)
	USplineComponent* SplineComponent;


	SplineComponent = CreateEditorOnlyDefaultSubobject<USplineComponent>(TEXT("SplineComponentsFrame1"));
	if (SplineComponent)
	{
		SplineComponent->SetClosedLoop(true);
		RootComponent = SplineComponent;
	}

This works well inside editor but in game, the splinecomponent is not created. I have tried a lot of things to make it work but it seems bugged any idea?

Change CreateEditorOnlyDefaultSubobject to CreateDefaultSubobject.

The CreateEditorOnlyDefaultSubobject function internally does a check for if this is an editor build and will not create that object in release mode.

Hope that helps!