Add spline mesh c++

Hi, how can i make a c++ that does exactly what “AddSplineMeshComponent” does at runtime, with the input and outputs it has

1

Try this

USplineMeshComponent * SplineComp = NewObject<USplineMeshComponent>(this, USplineMeshComponent::StaticClass() ,TEXT("MySpline"));
	if(SplineComp)
	{
		SplineComp->RegisterComponent();
	}