# How to compare actor types via line trace

**URL:** <https://forums.unrealengine.com/t/how-to-compare-actor-types-via-line-trace/1622155>\
**Category:** C++\
**Tags:** line-trace, compare, unreal-engine, CPP\
**Created:** [January 17, 2024, 7:19pm UTC](https://forums.unrealengine.com/t/how-to-compare-actor-types-via-line-trace/1622155 "2024-01-17T19:19:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheoRat3](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/theorat3/32/897542_2.png) [@TheoRat3](https://forums.unrealengine.com/u/TheoRat3)\
**Post date:** [January 17, 2024, 7:19pm UTC](https://forums.unrealengine.com/t/how-to-compare-actor-types-via-line-trace/1622155/1 "2024-01-17T19:19:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Shmoopy1701](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shmoopy1701/32/1194536_2.png) [@Shmoopy1701](https://forums.unrealengine.com/u/Shmoopy1701)\
**Post date:** [January 18, 2024, 4:29am UTC](https://forums.unrealengine.com/t/how-to-compare-actor-types-via-line-trace/1622155/2 "2024-01-18T04:29:14Z")

</div>

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

```auto
if(traceComponent->IsA(UStaticMeshComponent::StaticClass())
{
  // do something
}

```
