# How to create an enum pin in custom UK2Node ?

**URL:** <https://forums.unrealengine.com/t/how-to-create-an-enum-pin-in-custom-uk2node/1154264>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, nodes, custom-nodes, question, CPP\
**Created:** [May 4, 2023, 2:19pm UTC](https://forums.unrealengine.com/t/how-to-create-an-enum-pin-in-custom-uk2node/1154264 "2023-05-04T14:19:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cosmogonies](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cosmogonies](https://forums.unrealengine.com/u/cosmogonies)\
**Post date:** [May 4, 2023, 2:19pm UTC](https://forums.unrealengine.com/t/how-to-create-an-enum-pin-in-custom-uk2node/1154264/1 "2023-05-04T14:19:54Z")

</div>

Does anyone here have a snippet for creating an enum input pin in a custom **UK2Node**?  
In **AllocateDefaultPins** method, I use the _CreatePin_ function, but I can’t find a way to type an input pin with a specific enum of my own ! (or any other enum by the way)

I know how to do that with bool, string, and float values:

```auto

	const UEdGraphSchema_K2* DefaultSchema = GetDefault<UEdGraphSchema_K2>();

	UEdGraphPin* BooleanPin = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Boolean, "My Boolean Pin Name");
	DefaultSchema->SetPinAutogeneratedDefaultValue(BooleanPin, TEXT("false"));

	UEdGraphPin* StringPin = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_String, "My String Pin Name");
	DefaultSchema->SetPinAutogeneratedDefaultValue(StringPin, TEXT("DefaultValue"));

	UEdGraphPin* FloatPin = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Real, UEdGraphSchema_K2::PC_Float, "My Float Pin Name");
	DefaultSchema->SetPinAutogeneratedDefaultValue(FloatPin, TEXT("0.0"));

```

but I can’t find a way to use _CreatePin(EGPD\_Input, UEdGraphSchema\_K2::PC\_Enum,_  
Any help appreciated^^  
Thanks !

---

<div class="post-metadata">

**Author:** ![cosmogonies](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cosmogonies](https://forums.unrealengine.com/u/cosmogonies)\
**Post date:** [May 9, 2023, 10:03pm UTC](https://forums.unrealengine.com/t/how-to-create-an-enum-pin-in-custom-uk2node/1154264/2 "2023-05-09T22:03:19Z")

</div>

I have my solution^^

You have to use UEdGraphSchema\_K2::PC\_Byte for that case !  
(it may be related to that issue: [Unreal Engine Issues and Bug Tracker (UE-120214)](https://issues.unrealengine.com/issue/UE-120214))

A working way to create an Enum pin is doing it like that :

```auto
UEnum* PropertyEnum = StaticEnum<MyCppEnum>();
UEdGraphPin* MyCustomPin = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Byte, PropertyEnum, "PinName");

```
