# Why am I Getting Unrecognized type 'int'?

**URL:** <https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 20, 2014, 1:12am UTC](https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783 "2014-05-20T01:12:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![speewave](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@speewave](https://forums.unrealengine.com/u/speewave)\
**Post date:** [May 20, 2014, 1:12am UTC](https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783/1 "2014-05-20T01:12:56Z")

</div>

So i’m trying to create a basic Actor based class

A Coin, you pick it up, you get X amount of points (as decided by a variable)…

In BP this is a fairly simple thing, but in C++ It won’t work like expected,

```
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Actor)
	int CoinValue;

```

Is what i have so far, and i keep getting compiler errors that say ‘unrecognized type ‘int’’

Bool works, int8 works (yet shows up as a Bad type in BP editor), but int won’t work

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ecb5cc49](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ecb5cc49](https://forums.unrealengine.com/u/anonymous_user_ecb5cc49)\
**Post date:** [May 20, 2014, 1:16am UTC](https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783/2 "2014-05-20T01:16:10Z")

</div>

use int32

EDIT:

Or, you could have an enum to represent the different values assuming they are static. Like what I did for item types:

```auto
    UENUM(BlueprintType)
    enum SubitemType
    {
        food UMETA(DisplayName = "Food"),
        drink UMETA(DisplayName = "Drink"),
        healing_potion UMETA(DisplayName = "Healing Potion"),
        posion_potion UMETA(DisplayName = "Posion Potion"),
        fire_potion UMETA(DisplayName = "Fire Potion")
    };

```

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 20, 2014, 1:16am UTC](https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783/3 "2014-05-20T01:16:11Z")

</div>

#Dont Use Type Int

This was just recently addressed here:

> **[Why does returning int from UFunction result in unknown type int compiler error?](https://forums.unrealengine.com/questions/45090/returning-int-from-ufunction-results-in-unknown-ty.html)**
>
> Here’s a sample code snippet: UFUNCTION() int SomeFunc(); This results in a compiler error saying unknown type int. However, returning float, or types like int32, int16, etc… works. Are we not allowed to return int itself from UFUNCTION...

Dont ever use type int!

and dont use int8 in blueprints, its not working yet

**Use uint8, int32, uint32 for maximum happy happy**

#UE4 Documentation Link

> **[Coding Standard](https://docs.unrealengine.com/5.0/en-US/epic-cplusplus-coding-standardblueprint-debugging-in-unreal-engine/)**
>
> Write maintainable code by adhering to established standards and best practices.

**"Don’t use the C++ int type in portable code, since it’s dependent on the compiler how large it is."**

Rama

---

<div class="post-metadata">

**Author:** ![speewave](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@speewave](https://forums.unrealengine.com/u/speewave)\
**Post date:** [May 20, 2014, 1:20am UTC](https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783/4 "2014-05-20T01:20:27Z")

</div>

I see! Thanks for the help!

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [May 20, 2014, 1:21am UTC](https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783/5 "2014-05-20T01:21:46Z")

</div>

you’re welcome!

please check mark my answer and other people’s answers when your question is resolved so Epic knows the situation is under control 🙂

---

<div class="post-metadata">

**Author:** ![anon54778159](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anon54778159](https://forums.unrealengine.com/u/anon54778159)\
**Post date:** [March 27, 2015, 6:53am UTC](https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783/6 "2015-03-27T06:53:47Z")

</div>

Why is using the float type acceptable?

---

<div class="post-metadata">

**Author:** ![ryanjon2040](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ryanjon2040/32/906587_2.png) [@ryanjon2040](https://forums.unrealengine.com/u/ryanjon2040)\
**Post date:** [March 27, 2015, 7:16am UTC](https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783/7 "2015-03-27T07:16:20Z")

</div>

One quick addition to Rama’s reply. Do not use `uint32` for Blueprint as it is unsupported type. Only data types supported by Blueprints are `uint8`, `int32` and `float`.

See this reply from Epic for more info: [Missing support for uint32 int64 uint64 - C++ - Unreal Engine Forums](https://answers.unrealengine.com/questions/98206/missing-support-for-uint32-int64-uint64.html)

---

<div class="post-metadata">

**Author:** ![HuntaKiller](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HuntaKiller](https://forums.unrealengine.com/u/HuntaKiller)\
**Post date:** [August 14, 2015, 10:25am UTC](https://forums.unrealengine.com/t/why-am-i-getting-unrecognized-type-int/283783/8 "2015-08-14T10:25:37Z")

</div>

too bad uint doesnt work with blueprint
