Creating a spline matching actors rotation c++

Hi there,

I’ve been trying to figure this out for the last few days and I’m getting nowhere, I’m hoping someone can help me out, let me explain what I’m trying to do.

I have two actors on a map separated by some distance. I’m creating a spline with two points which match each of the actor’s locations.

This creates a straight spline to the centre of each of the actors. Great!

	TravelSpline = CreateDefaultSubobject<USplineComponent>(TEXT("TravelSpline"));
	TravelSpline->SetupAttachment(Main);
	TravelSpline->ClearSplinePoints();
	TravelSpline->AddSplinePoint(EntryPoint->GetComponentLocation(), ESplineCoordinateSpace::World);
	TravelSpline->AddSplinePoint(LinkedGate->ExitPoint->GetComponentLocation(), ESplineCoordinateSpace::World);

Looks like this

I then want each of the points to match the orientation of the actors there are near so the spline would look like the following:

I assumed I could just use the set rotation

TravelSpline->SetSplinePointType(0, ESplinePointType::CurveCustomTangent, true);
TravelSpline->SetRotationAtSplinePoint(0, EntryPoint->GetComponentRotation(), ESplineCoordinateSpace::World);

But that doesn’t seem to do anything.

I realise that I have to move the entry and exit tangents, but for the life of me I don’t know how to set these correctly using the information I have to hand i.e the actors.

I can do this and the tangents do change when the spline is created but I need to do this with the information I have to hand as the locations and rotations of the actors can change from place to place.

TravelSpline->SetTangentsAtSplinePoint(0, FVector(10,10, 10), FVector(20,20,20), ESplineCoordinateSpace::World, true);

I hope that is enough information for someone to give me a helping hand as to what I’m trying to do and how I go about solving it.

Many thanks in advance.