# ConstructorHelpers: Cannot convert argument 1 from 't\*' to 'UObject \*'

**URL:** <https://forums.unrealengine.com/t/constructorhelpers-cannot-convert-argument-1-from-t-to-uobject/459937>\
**Category:** Asset Creation\
**Tags:** convert, sprites, unreal-engine, CPP, question\
**Created:** [December 26, 2019, 10:37pm UTC](https://forums.unrealengine.com/t/constructorhelpers-cannot-convert-argument-1-from-t-to-uobject/459937 "2019-12-26T22:37:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CtnDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ctndev/32/1133321_2.png) [@CtnDev](https://forums.unrealengine.com/u/CtnDev)\
**Post date:** [December 26, 2019, 10:37pm UTC](https://forums.unrealengine.com/t/constructorhelpers-cannot-convert-argument-1-from-t-to-uobject/459937/1 "2019-12-26T22:37:25Z")

</div>

Getting very weird error while trying to get my sprite from C++. My code as follows :

```
    UPaperSpriteComponent* BaseBonusSpriteComponent;
    BaseBonusSpriteComponent = CreateDefaultSubobject<UPaperSpriteComponent>(TEXT("BaseBonusSpriteComponent"));
    ConstructorHelpers::FObjectFinder<UPaperSprite> DoublePoint(
        TEXT("PaperSprite'/Game/TexturesSprites/Collectables/Buff_2xPoint_Sprite.Buff_2xPoint_Sprite'"));
    int32 RandomBonusIndex = FMath::Rand() * 2;
    switch (RandomBonusIndex)
    {
    case 0:
        BaseBonusSpriteComponent->AttachTo(CollisionSphere);
        BaseBonusSpriteComponent->SetSprite(DoublePoint.Object);
        break;
     }

```

Getting error as:

void ConstructorHelpers::ValidateObject(UObject \*,const FString &,const TCHAR \*)’: cannot convert argument 1 from ‘T \*’ to 'UObject \*"

Anyone have solution for this?

---

<div class="post-metadata">

**Author:** ![RotemS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RotemS](https://forums.unrealengine.com/u/RotemS)\
**Post date:** [January 1, 2020, 11:44pm UTC](https://forums.unrealengine.com/t/constructorhelpers-cannot-convert-argument-1-from-t-to-uobject/459937/2 "2020-01-01T23:44:10Z")

</div>

You must include the header which defines UPaperSprite.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3b8e28f2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3b8e28f2](https://forums.unrealengine.com/u/anonymous_user_3b8e28f2)\
**Post date:** [March 10, 2021, 10:28pm UTC](https://forums.unrealengine.com/t/constructorhelpers-cannot-convert-argument-1-from-t-to-uobject/459937/3 "2021-03-10T22:28:31Z")

</div>

I think this is correct, because in order to use UPaperSpriteComponent you must include the header “PaperSpriteComponent.h” which at first I through included “PaperSprite.h”, but it only have a forward reference for the UPaperSprite class.
