# Ue4 generating breackpoints while trying to implement component class

**URL:** <https://forums.unrealengine.com/t/ue4-generating-breackpoints-while-trying-to-implement-component-class/299270>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 18, 2014, 3:46pm UTC](https://forums.unrealengine.com/t/ue4-generating-breackpoints-while-trying-to-implement-component-class/299270 "2014-11-18T15:46:58Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Whag](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Whag](https://forums.unrealengine.com/u/Whag)\
**Post date:** [November 18, 2014, 9:03pm UTC](https://forums.unrealengine.com/t/ue4-generating-breackpoints-while-trying-to-implement-component-class/299270/5 "2014-11-18T21:03:05Z")

</div>

Hi , thanks for answering 😉

I finally managed to get it works by pacthing knowledge from here and there, my biggest mistake was problably initializing it the wrong way in the constructor. Here is what I did if someone ever asks

I derived from ActorComponent, giving me a class I had to manually link to my pawn, this error message came when i put

```
      UPROPERTY(Category = Comp, VisibleDefaultsOnly, BlueprintReadOnly)µ
      TSubobjectPtr[class UOF_ColorComponent] ColorComp;

```

(I replaced \<\> by [] here because things inside disappear)

and tryed to initialize it by following

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

wich didn’t seems to work ( I am an almost total newb in c++ and programming btw, I might be wrong 😉

after doing some research I ended with a simple

```
      AOF_Pawn::AOF_Pawn(const class FPostConstructInitializeProperties& PCIP)
      : Super(PCIP)
      {
      ColorComp = PCIP.CreateDefaultSubobject[UOF_ColorComponent](this, TEXT("ColorComp"));
      }

```

and #include “OF\_ColorComponent” in my header file

it seems to do what I’m looking for so far, inheritance of my component class, I just hope I didn’t miss something for the moment I’ll call it in any functions later.

---

_[View the full topic](https://forums.unrealengine.com/t/ue4-generating-breackpoints-while-trying-to-implement-component-class/299270)._
