Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AMasterEnemy::LaunchAttack(UTask_LaunchAttack* AttackTask)
- {
- //SetActorRotation()
- FVector Start = GetActorLocation();
- FVector Target = (UGameplayStatics::GetPlayerCharacter(GetWorld(), 0))->GetActorLocation();
- // probably need to subtract here
- FRotator Rot = FRotationMatrix::MakeFromX(Target - Start).Rotator();
- SetActorRotation(Rot);
- GLog->Log("Playing attack montage");
- PlayAnimMontage(AttackMontage);
- float SequenceLength = AttackMontage->CalculateSequenceLength();
- /*
- FLatentActionInfo Info;
- Info.CallbackTarget = AttackTask;
- Info.ExecutionFunction = "OnAttackLaunched";
- Info.Linkage = 1;
- Info.UUID = 8888;
- UKismetSystemLibrary::Delay(this, SequenceLength, Info);
- */
- //FTimerHandle TimerHandler;
- //FTimerDelegate TimerDelegate;
- //TimerDelegate.BindUFunction(this, "OnAttackLaunched");
- //TimerDelegate.BindLambda([&]()
- //{
- // PlayAnimMontage(AttackMontage);
- //});
- //GetWorld()->GetTimerManager().SetTimer(TimerHandler, TimerDelegate, SequenceLength, false);
- AttackTask->OnAttackLaunched();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement