# Using the UDamageType Class

**URL:** <https://forums.unrealengine.com/t/using-the-udamagetype-class/295750>\
**Category:** C++\
**Tags:** classes, initialize, unreal-engine, UE4, CPP, question\
**Created:** [October 10, 2014, 12:28am UTC](https://forums.unrealengine.com/t/using-the-udamagetype-class/295750 "2014-10-10T00:28:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janyx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Janyx](https://forums.unrealengine.com/u/Janyx)\
**Post date:** [October 10, 2014, 12:28am UTC](https://forums.unrealengine.com/t/using-the-udamagetype-class/295750/1 "2014-10-10T00:28:41Z")

</div>

I am trying to add projectiles to my game (bullets that my gun will shoot). I want them to deal damage obviously so I initialized it as followed:

```
    /** type of damage */
	UPROPERTY(EditDefaultsOnly, Category = WeaponStat)
	TSubclassOf<UDamageType> DamageType;

	/** defaults */
	FProjectileWeaponData()
	{
		ProjectileClass = NULL;
		ProjectileLife = 10.0f;
		ExplosionDamage = 100;
		ExplosionRadius = 300.0f;
		DamageType = UDamageType::StaticClass();
	}

```

The last line DamageType = UDamageType::StaticClass(); I get an error that says

```
 "Error: Incomplete type is not allowed"

```

When I try and run anyways I get the error

```
"error C2027: use of undefined type 'UDamageType'"

```

I am using unreal engine 4.4.3 if that helps at all. If anyone knows what is going on please let me know. Thanks for the help!

---

<div class="post-metadata">

**Author:** ![cgrebeld](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cgrebeld](https://forums.unrealengine.com/u/cgrebeld)\
**Post date:** [October 10, 2014, 12:51am UTC](https://forums.unrealengine.com/t/using-the-udamagetype-class/295750/2 "2014-10-10T00:51:31Z")

</div>

Did you include DamageType.h?

---

<div class="post-metadata">

**Author:** ![Janyx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Janyx](https://forums.unrealengine.com/u/Janyx)\
**Post date:** [October 10, 2014, 12:57am UTC](https://forums.unrealengine.com/t/using-the-udamagetype-class/295750/3 "2014-10-10T00:57:57Z")

</div>

I tried but is said that no such file existed. I wonder if the header file is called something else.

---

<div class="post-metadata">

**Author:** ![cgrebeld](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cgrebeld](https://forums.unrealengine.com/u/cgrebeld)\
**Post date:** [October 10, 2014, 2:25am UTC](https://forums.unrealengine.com/t/using-the-udamagetype-class/295750/4 "2014-10-10T02:25:24Z")

</div>

It’s here:  
Runtime/Engine/Classes/GameFramework/DamageType.h

---

<div class="post-metadata">

**Author:** ![Janyx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Janyx](https://forums.unrealengine.com/u/Janyx)\
**Post date:** [October 10, 2014, 2:42am UTC](https://forums.unrealengine.com/t/using-the-udamagetype-class/295750/5 "2014-10-10T02:42:36Z")

</div>

I see I need to type #include “GameFramework/DamageType.h”. That way it knows where to look
