How to compare actor types via line trace

I have weak point actors in a shooter project of mine attached to sockets on enemy skeletal meshes. What I’m looking for is a means to validate if the actor type hit by a line trace is of type AWeakPoint. Is there a comparison function I can use given the info stored in FHitResult, or maybe an Object trace channel? Any ideas?

You can IsA() on the FHitResult::GetActor() or FHitResult.GetComponent().

if(traceComponent->IsA(UStaticMeshComponent::StaticClass())
{
  // do something
}
1 Like