# 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:** 6\
**Page:** 1

<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, 3:46pm UTC](https://forums.unrealengine.com/t/ue4-generating-breackpoints-while-trying-to-implement-component-class/299270/1 "2014-11-18T15:46:58Z")

</div>

I created a component class appearing in blueprint component tab and I can assign it here, everything is fine. But when I try to call it from my c++ character, compilation goes “UE4Editor.exe has triggered a breakpoint.”

removing this line remove the breackpoint

```
UPROPERTY(Category = Category, VisibleDefaultsOnly, BlueprintReadOnly)
	TSubobjectPtr<class UMyClass> NameOfMyClass;

```

Is the synthax incorrect ?

---

<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, 3:50pm UTC](https://forums.unrealengine.com/t/ue4-generating-breackpoints-while-trying-to-implement-component-class/299270/2 "2014-11-18T15:50:08Z")

</div>

(UPROPERTY(Category = Category, VisibleDefaultsOnly, BlueprintReadOnly)  
TSubobjectPtr\< class UMyClass\> NameOfMyClass;

had to add a space beside TSubObjectPtr\< ^!^

---

<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, 4:36pm UTC](https://forums.unrealengine.com/t/ue4-generating-breackpoints-while-trying-to-implement-component-class/299270/3 "2014-11-18T16:36:07Z")

</div>

[A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums](https://wiki.unrealengine.com/Custom_Character_Movement_Component)…

---

<div class="post-metadata">

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

</div>

Hey Whag-

We’re trying to reproduce this issue on our end however I will need some additional information from you so we can ensure we are getting the same results. Does the error message say anything else or just that a breakpoint has been triggered? When you created your component class what parent class did you choose to base it on? Also, how are you making the call to the class inside the blueprint? Are the lines of code that you posted above in the c++ character or the component class? Any information you can include regarding the setup will make it easier for us to investigate this problem

Cheers

---

<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.

---

<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:32pm UTC](https://forums.unrealengine.com/t/ue4-generating-breackpoints-while-trying-to-implement-component-class/299270/6 "2014-11-18T21:32:27Z")

</div>

the breakpoint bug seems to appear when there is nothing (or bad) linked in my pawn constructor while my UPROPERTY stands in the header
