# How to create new touch interface in C++

**URL:** <https://forums.unrealengine.com/t/how-to-create-new-touch-interface-in-c/487361>\
**Category:** UI\
**Tags:** touch-interface, unreal-engine, UI, question, CPP\
**Created:** [August 12, 2021, 12:48pm UTC](https://forums.unrealengine.com/t/how-to-create-new-touch-interface-in-c/487361 "2021-08-12T12:48:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IdleAir](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IdleAir](https://forums.unrealengine.com/u/IdleAir)\
**Post date:** [August 12, 2021, 12:48pm UTC](https://forums.unrealengine.com/t/how-to-create-new-touch-interface-in-c/487361/1 "2021-08-12T12:48:16Z")

</div>

Hello there,  
I’m trying to destroy/create different touch interface in C++ during the game. Basically what I’m doing is:  
In header, expose class variable. For some reason if I use TSubclassOf I cannot get the Touch Interface Setup created in content.

```
UPROPERTY(EditDefaultsOnly, Category = "Misc")
	UTouchInterface* InGameTouchInterfaceClass;

```

In CPP:

```
	m_gameTouchInterface = NewObject<UTouchInterface>(InGameTouchInterfaceClass);
	if (m_gameTouchInterface) {
		Log("Create touch interface!");
		m_playerCtrller->ActivateTouchInterface(m_gameTouchInterface);
	}

```

The code logs “Create touch interface” and no error reported. But the interface didn’t show up. Please help ;D

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [August 13, 2021, 3:19pm UTC](https://forums.unrealengine.com/t/how-to-create-new-touch-interface-in-c/487361/2 "2021-08-13T15:19:23Z")

</div>

Hello! Do you check **bAlwaysShowTouchInterface** option in Project Input Settings?

---

<div class="post-metadata">

**Author:** ![IdleAir](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IdleAir](https://forums.unrealengine.com/u/IdleAir)\
**Post date:** [August 14, 2021, 8:39am UTC](https://forums.unrealengine.com/t/how-to-create-new-touch-interface-in-c/487361/3 "2021-08-14T08:39:16Z")

</div>

It turns out that I should directly put:

ctrller-\>ActivateTouchInterface(InGameTouchInterfaceClass)

instead of creating a new uboject and assign to it… If anyone wonder how to do it, this is the way I found ;D. Thank you anyway!
