asasj57 发表于 2017-3-26 12:11:52

spline 左右移动功能怎么写呢?

本帖最后由 asasj57 于 2017-3-27 09:40 编辑

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);
}

NewLocation=ActiveSplineComponent->GetLocationAtDistanceAlongSpline(Value * SplineLength, ESplineCoordinateSpace::World);这个代码 spline 下一个点的 左右移动的话,怎么写才行呢?

asasj57 发表于 2017-3-26 12:11:53

以上2个功能代码,应该怎么写才行呢?

mxlhy 发表于 2017-3-27 09:19:24

看看,学习下
页: [1]
查看完整版本: spline 左右移动功能怎么写呢?