Set timeline start point OnOverlap
This commit is contained in:
parent
3642b9418b
commit
9436d16875
|
@ -78,6 +78,14 @@ void APickup::OnOuterBeginOverlap(UPrimitiveComponent* OverlappedComponent, AAct
|
|||
{
|
||||
PickupLocation = GetActorLocation();
|
||||
PlayTimeLine();
|
||||
|
||||
double dist = FVector::Distance(GetActorLocation(), PlayerCharacter->GetActorLocation());
|
||||
|
||||
if (dist < OuterSphereComponent->GetScaledSphereRadius())
|
||||
{
|
||||
double ratio = FMath::Abs((dist / OuterSphereComponent->GetScaledSphereRadius()) - 1.0f);
|
||||
TimelineComponent->SetNewTime(ratio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue