SetLocationAtSplinePoint does not set the location

Hey guys.

I’m using USplineComponent to give the player the ability to construct conveyor lines within a factory.
The flow for constructing a conveyor line, goes something like this:

  1. The player picks the conveyor line type they wish to construct
  2. We spawn the actor with the USplineComponent and construct meshes along the spline based on various variables
  3. The actor follows the cursor around, by setting the actor location SetActorLocation()
  4. When the player clicks LMB, we will no longer move the entire actor, but move the last spline point (spline point index 0)
  5. When the player clicks LMB, nothing will follow the cursor anymore, and the player has now constructed a conveyor line.

There is one step in the middle that I’d like the player to be able to do. That is raising and lowering the height of the conveyor, depending on what spline point we’re currently moving around. If we’re moving the entire actor, it’s spline point at index 0. If the player already clicked the LMB once, and therefore we’re only moving the last splint point index, it’s spline point index 1.

It should be said, that ew’re talking about runtime functionality for the USplineComponent. This is not in the editor, but rather during gameplay.

Consider the following function for raising (lowering is basically just the opposit on the Z axis)

void AConveyorLine::Raise()
{
	int32 SplinePointToRaise = bInitialConstruct ? GetInitialConstructSplinePointToRaiseAndLower() : GetSplinePointToMove();
	FVector CurrentSplinePointLocation = Spline->GetLocationAtSplinePoint(SplinePointToRaise, ESplineCoordinateSpace::Local);

	// Create and add the elevation vector
	FVector ElevationVector(0.f, 0.f, ElevationAmountPerStep);
	FVector NewLocation = CurrentSplinePointLocation + ElevationVector;

	// If we've reached the maximum height limit
	if (NewLocation.Z > MaximumElevation)
		return;

	// Set the new location of the spline point that we're currently manipulating
	Spline->SetLocationAtSplinePoint(SplinePointToRaise, NewLocation, ESplineCoordinateSpace::Local);
	
	// Construct meshes along the spline
	ConstructMeshes(); 
}

This all seems to work fine for spline point at index 0. Now, when the user clicks LMB once, we should raise/lower the second spline point, at index 1. This is where it goes wrong. I debugged, logged, and checked everything, but the location of the spline point at index 1, won’t move at all, even though it should be raised 75 units on the Z axis.

I get no errors what so ever, it’s just as if the new location is not being set at the spline point index 1. If I hardcode to spline point index 0, both the raise as well as the lower function, works just fine. But it won’t let me alter the Z axis value for spline point at index 1.

Anyone know what’s happening here?