あちらのHandleProgressの部分を少し改変して組み込んだらうまくコンパイルできました
しかし肝心の球体が動いていない状態でテレポーテーションもその場で消えたりついたりを繰り返しています
コンストラクタに以下の文を追加してもくねくね動きません
MyTimeline.SetTimelineLength(1.0f);
static ConstructorHelpers::FObjectFinder<UCurveFloat> Curve(TEXT("CurveFloat'/Game/StarterContent/MovingCurve.MovingCurve'"));
check(Curve.Succeeded());
FloatCurve = Curve.Object;
質問の内容が変わって申し訳ないですがお力添えよろしくお願いいたします
.cpp
void ASoundLocation::moving()
{
if (FloatCurve)
{
FOnTimelineFloat ProgressFunction;
ProgressFunction.BindUFunction(this, FName(“HandleProgress”));
MyTimeline.AddInterpFloat(FloatCurve, ProgressFunction);
ActorInitialRotation.Yaw = Sound_m[i] * 45;
TargetRotation = ActorInitialRotation = GetActorRotation();
TargetRotation.Yaw += MaxBounceHeight;
MyTimeline.SetLooping(true);
MyTimeline.PlayFromStart();
}
SetActorLocation(SetPos);
GEngine->AddOnScreenDebugMessage(-1, 8.10f, FColor::Yellow, RowData_m[i]);
GEngine->AddOnScreenDebugMessage(-1, 8.10f, FColor::Yellow, TEXT("Waiting Compreted"));
i++;
GetWorldTimerManager().SetTimer(Timer, this, &ASoundLocation::waiting_m, delayTime, false);
}
void ASoundLocation::HandleProgress(float Value )
{
//アクターの新しい場所を設定する
FRotator NewRotation = FMath::Lerp(ActorInitialRotation,TargetRotation,Value);
SetActorRotation(NewRotation);
}