| FRotator rotator = UKismetMathLibrary::FindLookAtRotation(MeshComp->GetOwner()->GetActorLocation(), action->GetMousePointer()); | |
|---|---|
| FVector vec = rotator.Vector(); | |
| action->DownLaunch(StaticCast<ACharacter*>(MeshComp->GetOwner()), vec); |
void UCActionComponent::DownLaunch(ACharacter* character, FVector vec)
{
CLog::Print(vec * 2000, 1);
CLog::Print(character->GetActorForwardVector(), 2);
character->LaunchCharacter((vec * 2000), true, false);
TArray<AActor*> a;
FHitResult r;
UKismetSystemLibrary::LineTraceSingle(character->GetWorld(), character->GetActorLocation(), character->GetActorLocation() + vec * 2000, ETraceTypeQuery::TraceTypeQuery1, false, a, EDrawDebugTrace::ForDuration, r, true);
}
The trace is shot as the direction vector to fly.
But it won’t fly…
It only falls down!
Help…