How to AddSplineMeshComponent in code

I want to achieve same thing what is in this tutorial but with c++.


I know how to add one SplineMeshComponent but this in only single class varible. There’s no function like AddSplineMeshComponent

SplineMeshComponent->SetStaticMesh(StaticMeshSpline.Object);

I don’t have idea how to add another SplineMeshComponent for next Spline Points.
Any help?
Thanks.

1 Like

Ok. Sorry that I’m spamming this place by talking with myself but I just need to use this
ObjectInitializer.CreateDefaultSubobject(this, TEXT(“SplineMeshComponent0”));

1 Like