the hit_result variable always returns an incorrect ImpactPoint of (0.0, 0.0, 0.0), and this happened all of a sudden, it worked perfectly fine before.
void AWeapon::OnBoxBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult){
const FVector start {trace_start->GetComponentLocation()};
const FVector end {trace_end->GetComponentLocation()};
TArray <AActor*> actors_to_ignore;
FHitResult hit_result;
IIHitInterface *hit_actor;
if ( actor_to_ignore && is_equiped == true && can_damage == true ){
actors_to_ignore.AddUnique(actor_to_ignore);
UKismetSystemLibrary::SphereTraceSingle(this, start, end, 5.f,
ETraceTypeQuery::TraceTypeQuery1, false, actors_to_ignore,
EDrawDebugTrace::ForDuration, hit_result, true);
UWorld *world {GetWorld()};
if (world)
DrawDebugPoint(world, hit_result.ImpactPoint, 3.f, FColor::Cyan, false, 5.f);
hit_actor = Cast <IIHitInterface> (OtherActor);
if ( hit_actor != nullptr ){
static int x {};
hit_actor->get_hit(hit_result.ImpactPoint);
can_damage = false;
}
}
}