# UENUM enum class with uint8

**URL:** <https://forums.unrealengine.com/t/uenum-enum-class-with-uint8/434902>\
**Category:** C++\
**Tags:** UEnum, ENUM, unreal-engine, CPP, question\
**Created:** [October 2, 2018, 6:41pm UTC](https://forums.unrealengine.com/t/uenum-enum-class-with-uint8/434902 "2018-10-02T18:41:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_0b55f4d0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0b55f4d0](https://forums.unrealengine.com/u/anonymous_user_0b55f4d0)\
**Post date:** [October 2, 2018, 6:41pm UTC](https://forums.unrealengine.com/t/uenum-enum-class-with-uint8/434902/1 "2018-10-02T18:41:41Z")

</div>

Hello, I have a question here about the enum class in UE4 , now is the I have more than 255 values to set in a enum class like :

```
ENUM(BlueprintType)
enum class ECityMapMeshTag : uint8
{
  RoadTwoLanes_LaneLeft UMETA(DisplayName = "Road: Two Lanes - Lane Left"),
  RoadTwoLanes_LaneRight UMETA(DisplayName = "Road: Two Lanes - Lane Right"),
  RoadTwoLanes_SidewalkLeft UMETA(DisplayName = "Road: Two Lanes - Sidewalk Left"),
  RoadTwoLanes_SidewalkRight UMETA(DisplayName = "Road: Two Lanes - Sidewalk Right"),
  RoadTwoLanes_LaneMarkingSolid UMETA(DisplayName = "Road: Two Lanes - Lane Marking Solid"),
  RoadTwoLanes_LaneMarkingBroken UMETA(DisplayName = "Road: Two Lanes - Lane Marking Broken"),
...
...
...
\\\more than 255 Tags.
  NUMBER_OF_TAGS UMETA(Hidden),
  INVALID UMETA(Hidden)
};

```

But type enums support uint8 only, can I use uint32 instead of uint8? if not , how can I do to make the maximal value more than 255??

---

<div class="post-metadata">

**Author:** ![Ali\_Akbar](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ali_akbar/32/1008648_2.png) [@Ali\_Akbar](https://forums.unrealengine.com/u/Ali_Akbar)\
**Post date:** [October 3, 2018, 3:20am UTC](https://forums.unrealengine.com/t/uenum-enum-class-with-uint8/434902/2 "2018-10-03T03:20:42Z")

</div>

It works without blueprint support, but if you want to expose this to blueprints, you’ll have to stick with uint8

```
UENUM()
enum class ECityMapMeshTag : uint16
{
	RoadTwoLanes_LaneLeft UMETA(DisplayName = "Road: Two Lanes - Lane Left")
};

```

The above code compiles just fine if I remove BlueprintType from UENUM

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0b55f4d0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0b55f4d0](https://forums.unrealengine.com/u/anonymous_user_0b55f4d0)\
**Post date:** [October 5, 2018, 4:55pm UTC](https://forums.unrealengine.com/t/uenum-enum-class-with-uint8/434902/3 "2018-10-05T16:55:32Z")

</div>

Thanks, that helps.

---

<div class="post-metadata">

**Author:** ![TheDreamCatcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thedreamcatcher/32/727178_2.png) [@TheDreamCatcher](https://forums.unrealengine.com/u/TheDreamCatcher)\
**Post date:** [October 6, 2018, 5:19am UTC](https://forums.unrealengine.com/t/uenum-enum-class-with-uint8/434902/4 "2018-10-06T05:19:53Z")

</div>

the other way around would be to rethink your enums. You might want to shrunk down such a massive enum into smaller pieces that would be more relevant. For instance separate things in two at first with sidewalks in an enum and main road in an other, and so on.

---

<div class="post-metadata">

**Author:** ![MRSagor949](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MRSagor949](https://forums.unrealengine.com/u/MRSagor949)\
**Post date:** [January 25, 2021, 8:48pm UTC](https://forums.unrealengine.com/t/uenum-enum-class-with-uint8/434902/5 "2021-01-25T20:48:57Z")

</div>

Hey, When I try to create enum with class . I got a lots of erros in my visual studio . Now how can i fix it.  
#pragma once

#include “CoreMinimal.h”  
#include “MRSEnumLibrary.generated.h”

UENUM(BlueprintType)  
enum class EGait : uint8  
{  
Walking,  
Running,  
Sprinting,  
};

I don’t know what is the prlm.

---

<div class="post-metadata">

**Author:** ![MRSagor949](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MRSagor949](https://forums.unrealengine.com/u/MRSagor949)\
**Post date:** [January 26, 2021, 9:40pm UTC](https://forums.unrealengine.com/t/uenum-enum-class-with-uint8/434902/6 "2021-01-26T21:40:36Z")

</div>

I could not create any types of enum in my header file with a none c++ class.

 ![328178-screenshot-5.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/d/bdd3f0b6302f2d533d4a7fc8986c9da720e62e1e.png)

---

<div class="post-metadata">

**Author:** ![RodrigoCezarUE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RodrigoCezarUE](https://forums.unrealengine.com/u/RodrigoCezarUE)\
**Post date:** [August 18, 2025, 8:18pm UTC](https://forums.unrealengine.com/t/uenum-enum-class-with-uint8/434902/7 "2025-08-18T20:18:37Z")

</div>

Comma only for separating the elements, the last one is not necessary
