Situation
I’m trying to make a trace that can identify what it is. HOWEVER It only identifies a Static Mesh.
void AWeapon::ProcessInstantHit(const FHitResult& Impact, const FVector& Origin, const FVector& ShootDir, int32 RandomSeed, float ReticleSpread)
{
if (Impact.bBlockingHit) //if anything is blocking the trace
{
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, TEXT("HIT SOMETHING!!!"));
DrawDebugLine(this->GetWorld(), Origin, Impact.TraceEnd, FColor::Black, true, 10000.f, 10.f); //Draws line to impacted hit
DrawDebugPoint(this->GetWorld(), Impact.TraceEnd, 100.f, FColor::Black, true, 10000.f, 10.f); //Draws box where the trace has hit
}
if (Impact.GetActor())
{
AActor *HitActor = Cast<AActor>(Impact.GetActor());
if (HitActor->IsA(AEnemy::StaticClass()))
{
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, TEXT("ENEMY HIT-----------"));
}
}
else
{
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, TEXT("NOTHING TO HITTTTTTT"));
}
}
This is the code i have for the trace. Everything works fine absolutely fine, just the trace wont identify ANYTHING unless it’s a Static Mesh.
HELP
Is it a bug that using a trace only identifies Static Meshes? It wont identify My Skeletal mesh at all. Does anyone have a solution to this problem?