# Best way to check class type in C++

**URL:** <https://forums.unrealengine.com/t/best-way-to-check-class-type-in-c/396569>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 24, 2017, 1:28am UTC](https://forums.unrealengine.com/t/best-way-to-check-class-type-in-c/396569 "2017-06-24T01:28:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GigasightMedia](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigasightMedia](https://forums.unrealengine.com/u/GigasightMedia)\
**Post date:** [June 24, 2017, 6:14pm UTC](https://forums.unrealengine.com/t/best-way-to-check-class-type-in-c/396569/2 "2017-06-24T18:14:01Z")

</div>

Probably best to go with “IsA”

```
if(myGrabbedItem->IsA(ABaseWeapon::StaticClass()))
{
    this->GrabWeapon(myGrabbedItem);
}
else
{
    this->GrabItem(myGrabbedItem);
}

```

> **[IsA](https://docs.unrealengine.com/4.27/en-US/API/Runtime/CoreUObject/UObject/UObjectBaseUtility/IsA/)**
>
> Overload list

---

_[View the full topic](https://forums.unrealengine.com/t/best-way-to-check-class-type-in-c/396569)._
