# How can i compare DamageType, that i wrote in ApplyRadialDamage, with another DamageType?

**URL:** <https://forums.unrealengine.com/t/how-can-i-compare-damagetype-that-i-wrote-in-applyradialdamage-with-another-damagetype/1525730>\
**Category:** C++\
**Tags:** radial-damage, damage, apply-damage, unreal-engine, Code, CPP\
**Created:** [December 14, 2023, 6:15pm UTC](https://forums.unrealengine.com/t/how-can-i-compare-damagetype-that-i-wrote-in-applyradialdamage-with-another-damagetype/1525730 "2023-12-14T18:15:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sa1lim.RAM](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sa1lim.ram/32/681130_2.png) [@sa1lim.RAM](https://forums.unrealengine.com/u/sa1lim.RAM)\
**Post date:** [December 14, 2023, 6:15pm UTC](https://forums.unrealengine.com/t/how-can-i-compare-damagetype-that-i-wrote-in-applyradialdamage-with-another-damagetype/1525730/1 "2023-12-14T18:15:23Z")

</div>

I have a situation. My NPC has immunity to a DamageType. In function OnTakeRadialDamage i must compare DamageType, that NPS get and DamageType, th witch NPS has immunity. Attetion! I’m codding on C++, but immunity DamageType is set in BP. How can i crack this question?

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [December 15, 2023, 6:14pm UTC](https://forums.unrealengine.com/t/how-can-i-compare-damagetype-that-i-wrote-in-applyradialdamage-with-another-damagetype/1525730/2 "2023-12-15T18:14:12Z")

</div>

The immunity damage type would have to either a) be a c++ variable (which you could still configure in a blueprint) or b) have a function that you can call from native and implement in blueprint that can either return the value or do the comparison you need.
