# Make a custom SpringArmComponent

**URL:** <https://forums.unrealengine.com/t/make-a-custom-springarmcomponent/407754>\
**Category:** Blueprint\
**Tags:** springarm, nullptr, unreal-engine, question, Blueprint, CPP\
**Created:** [October 23, 2017, 7:23pm UTC](https://forums.unrealengine.com/t/make-a-custom-springarmcomponent/407754 "2017-10-23T19:23:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Borkleby](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Borkleby](https://forums.unrealengine.com/u/Borkleby)\
**Post date:** [October 23, 2017, 7:23pm UTC](https://forums.unrealengine.com/t/make-a-custom-springarmcomponent/407754/1 "2017-10-23T19:23:52Z")

</div>

Hello internet, I need help doing this. I am experienced in C++ but not so much working with C++ and Unreal together. I need to make a custom spring arm component that can move and rotate around freely. I have already made my own custom SpringArmComponent, but something is horribly wrong. At runtime, the component is a nullptr and it returns no value though it does appear in the blueprint editor. Something’s missing… but what?

---

<div class="post-metadata">

**Author:** ![janimationd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@janimationd](https://forums.unrealengine.com/u/janimationd)\
**Post date:** [October 23, 2017, 8:13pm UTC](https://forums.unrealengine.com/t/make-a-custom-springarmcomponent/407754/2 "2017-10-23T20:13:33Z")

</div>

Are you trying to define a C++ class that extends SpringArmComponent, or trying to create an instance of it that shows up in blueprints?

---

<div class="post-metadata">

**Author:** ![staticvoidlol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@staticvoidlol](https://forums.unrealengine.com/u/staticvoidlol)\
**Post date:** [October 23, 2017, 9:14pm UTC](https://forums.unrealengine.com/t/make-a-custom-springarmcomponent/407754/3 "2017-10-23T21:14:46Z")

</div>

Did you decorate the member declaration with the UPROPERTY() macro e.g. in the class where you’re creating an instance of it?

```
UPROPERTY(BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class UPWNSpringArmComponent* CameraBoom;

```

Otherwise it will be garbage collected and result in a nullptr.  
At the risk of stating the obvious you also need to actually create it, e.g. in your constructor:

```
CameraBoom = CreateDefaultSubobject<UPWNSpringArmComponent>(TEXT("CameraBoom"));
```
