本帖最后由 asasj57 于 2017-3-27 09:40 编辑
[mw_shl_code=cpp,true]void AShortTrackCharacter::TickTimeline(float Value)
{
float SplineLength = ActiveSplineComponent->GetSplineLength();
FRotator NewRotation = ActiveSplineComponent->GetRotationAtDistanceAlongSpline(Value * SplineLength, ESplineCoordinateSpace::World);
NewRotation.Pitch = 0;
SetActorRotation(NewRotation);
NewLocation = ActiveSplineComponent->GetLocationAtDistanceAlongSpline(Value * SplineLength, ESplineCoordinateSpace::World);
NewLocation = FVector(NewLocation.X, NewLocation.Y+ speedRight, NewLocation.Z);
SetActorLocation(NewLocation);
}[/mw_shl_code]
NewLocation=ActiveSplineComponent->GetLocationAtDistanceAlongSpline(Value * SplineLength, ESplineCoordinateSpace::World); 这个代码 spline 下一个点的 左右移动的话,怎么写才行呢?
|