# Issues Creating TextRender Component

**URL:** <https://forums.unrealengine.com/t/issues-creating-textrender-component/298455>\
**Category:** C++\
**Tags:** unreal-engine, textrendercomponent, question, CPP\
**Created:** [November 8, 2014, 12:26am UTC](https://forums.unrealengine.com/t/issues-creating-textrender-component/298455 "2014-11-08T00:26:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_e8414475](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e8414475](https://forums.unrealengine.com/u/anonymous_user_e8414475)\
**Post date:** [November 8, 2014, 12:26am UTC](https://forums.unrealengine.com/t/issues-creating-textrender-component/298455/1 "2014-11-08T00:26:44Z")

</div>

Header:

```
class FE_API AFEObject : public AActor
{
	GENERATED_UCLASS_BODY()
	
	UPROPERTY(VisibleDefaultsOnly, Category = Object)
	TSubobjectPtr<class UCapsuleComponent> Capsule;

	UPROPERTY(VisibleDefaultsOnly, Category = Mesh)
	TSubobjectPtr<class USkeletalMeshComponent> Mesh;

	UPROPERTY(VisibleDefaultsOnly, Category = Text)
	TSubobjectPtr<class UTextRenderComponent> FloatingText;

};

```

CPP:

```
AFEObject::AFEObject(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{

	Capsule = PCIP.CreateDefaultSubobject<UCapsuleComponent>(this, TEXT("Capsule"));
	this->SetRootComponent(Capsule);

	Mesh = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("ObjectMesh"));
	Mesh->AttachParent = Capsule;

	FloatingText = PCIP.CreateDefaultSubobject<UTextRenderComponent>(this, TEXT("ObjectMesh"));

}

```

The error is:

error C2439: ‘TSubobjectPtrConstructor::Object’ : member could not be initialized

error C2440: ‘initializing’ : cannot convert from ‘UTextRenderComponent \*’ to ‘UObject \*’

I checked the docs and it says UTextRenderComponent is a UObject, so I don’t understand what the problem is.

---

<div class="post-metadata">

**Author:** ![harm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@harm](https://forums.unrealengine.com/u/harm)\
**Post date:** [November 8, 2014, 6:58pm UTC](https://forums.unrealengine.com/t/issues-creating-textrender-component/298455/2 "2014-11-08T18:58:03Z")

</div>

It probably has something to do with your includes. Are you using EngineMinimal.h or Engine.h in your FE.h file? Using the latter one might solve your problem.

Additionally, you named your Mesh and FloatingText the same which will cause issues when launching.
