Hello I’m trying to add a spline component to my actor class and its not suppose to occur in the constructor but during runtime in a function/method I made for updating an arc spline… I’m having trouble with how to write for it and the documentation doesn’t have an example that I can find or in the forums, or anywhere really.
where I’m at in the method for anybody wondering what I mean:
void AVRMotionController::UpdateArcSpline(bool FoundValidLocation, TArray<FVector> SplinePoints)
{
if (!FoundValidLocation)
{
SplinePoints.Empty();
SplinePoints.Add(ArcDirection->GetComponentLocation());
SplinePoints.Add((ArcDirection->GetForwardVector() * 20.0f) + ArcDirection->GetComponentLocation());
}
for (FVector Thing : SplinePoints)
{
ArcSpline->AddSplinePoint(Thing, ESplineCoordinateSpace::Local, true);
}
ArcSpline->SetSplinePointType(SplinePoints.Last, ESplinePointType::CurveClamped, true);
for (int index = 0; index < ArcSpline->GetNumberOfSplinePoints - 2; index++)
{
//AddComponent(FName("splineMesh"), true, RootComponent->GetRelativeTransform,)
}
}