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 下一个点的 左右移动的话,怎么写才行呢?
以上2个功能代码,应该怎么写才行呢? 看看,学习下
页:
[1]