# why is my button not clickable?

**URL:** <https://forums.unrealengine.com/t/why-is-my-button-not-clickable/837118>\
**Category:** UI\
**Tags:** unreal-engine, question\
**Created:** [April 1, 2023, 12:34pm UTC](https://forums.unrealengine.com/t/why-is-my-button-not-clickable/837118 "2023-04-01T12:34:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mueann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mueann](https://forums.unrealengine.com/u/Mueann)\
**Post date:** [April 1, 2023, 12:34pm UTC](https://forums.unrealengine.com/t/why-is-my-button-not-clickable/837118/1 "2023-04-01T12:34:08Z")

</div>

I create a button widget, which i can add to my inventory widget

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/c/47cb6f39d6294f07368e3501fd6b4c7563cf0f8b.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/f/aafb61779b001146c80530d7986da2692aacaab1.png)

I add button which this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/8/e/18e8bcbd7ca947fc307e974a699e257ce5a8a0a2.png)

In the game it looks like:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/0/df04c4c4adf620aa55878c71c253b76e8bece042.png)

But if i click on the button nothing happend, when my mouse cursor is on the button it remain unchanged

---

<div class="post-metadata">

**Author:** ![Mueann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mueann](https://forums.unrealengine.com/u/Mueann)\
**Post date:** [April 1, 2023, 2:24pm UTC](https://forums.unrealengine.com/t/why-is-my-button-not-clickable/837118/2 "2023-04-01T14:24:42Z")

</div>

{  
if (InventoryClass)  
{  
if (!IsValid(InventoryWidget))  
{  
InventoryWidget = CreateWidget(this, InventoryClass);  
if (IsValid(InventoryWidget))  
{  
InventoryWidget-\>AddToViewport();  
bIsMenuOpen = true;  
bShowMouseCursor = true;  
FInputModeUIOnly Mode;  
Mode.SetWidgetToFocus(InventoryWidget-\>TakeWidget());  
}  
}  
else if (IsValid(InventoryWidget) && !InventoryWidget-\>IsInViewport())  
{  
InventoryWidget-\>AddToViewport();  
bIsMenuOpen = true;  
bShowMouseCursor = true;  
FInputModeUIOnly Mode;  
Mode.SetWidgetToFocus(InventoryWidget-\>TakeWidget());  
}

```
	else if (IsValid(InventoryWidget) && InventoryWidget->IsInViewport())
	{
		bIsMenuOpen = false;
		InventoryWidget->RemoveFromParent();
		bShowMouseCursor = false;
		FInputModeGameOnly InputMode;
		SetInputMode(InputMode);
	}
}

```

function to open inventory
