If anyone is having issues with the Platform first teleporting to the end location and than
continuing the movement: Remove/Comment the SetActorLocation(StartLocation)
call (line 43 in the video).
I am also facing the same problem.
Did you had any luck solving it ?
I had this issue and it turned out to be a typo on my part. I used MoveDirection * MoveDirection instead of MoveDirection * MoveDistance ie I had Move"Direction" twice.
Hope it helps!
For anyone having this issue, the bug has to do with the order of operations.
You need to calculate the new StartLocation (where it ends) before reversing velocity. Reversing the velocity first causes the platform to jump to the other end if it were already going in the other direction.
float DistanceMoved = FVector::Dist(StartLocation, CurrentLocation);
if (DistanceMoved > MoveDistance)
{
// Calculate and set accurate end distance
FVector MoveDirection = PlatformVelocity.GetSafeNormal();
StartLocation += MoveDistance * MoveDirection;
SetActorLocation(StartLocation);
// Change Direction
PlatformVelocity = -PlatformVelocity;
}