void ABlackHole::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
TArray<UPrimitiveComponent*> Components;
AttractiveSphere->GetOverlappingComponents(Components);
for (UPrimitiveComponent* Component : Components)
{
if (Component && Component->IsSimulatingPhysics())
{
FVector DirectionToAttract = GetActorLocation() - Component->GetComponentLocation();
FVector Force = DirectionToAttract * ForceStrength;
Component->AddForce(Force);
/** REPLACE TO HEADER */
/* attractive sphere */
// UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
// class USphereComponent* AttractiveSphere;
/** the force strength to attract physics objects */
// UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Config", meta = (AllowPrivateAccess = "true"))
// float ForceStrength = 2500.f;
}
}
}