# How do i get a cpp class into another?

**URL:** <https://forums.unrealengine.com/t/how-do-i-get-a-cpp-class-into-another/462198>\
**Category:** C++\
**Tags:** constructors, unreal-engine, CPP, question, actor-class\
**Created:** [March 7, 2020, 9:31pm UTC](https://forums.unrealengine.com/t/how-do-i-get-a-cpp-class-into-another/462198 "2020-03-07T21:31:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonathanCDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JonathanCDev](https://forums.unrealengine.com/u/JonathanCDev)\
**Post date:** [March 7, 2020, 9:31pm UTC](https://forums.unrealengine.com/t/how-do-i-get-a-cpp-class-into-another/462198/1 "2020-03-07T21:31:54Z")

</div>

I have 2 cpp Actor Classes one is the main ground the other just billboards components. How can i get the Billboard class actor into the constructor of the main ground cpp class actor?

i have tryed:  
`CreateDefaultSubObject<>(); NewObject<>();`

 ![297444-screenshot-622.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/b/15ba9ac4f1196bae78a5cc626f83534ae7b604ac.jpeg)

---

<div class="post-metadata">

**Author:** ![GEODVS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GEODVS](https://forums.unrealengine.com/u/GEODVS)\
**Post date:** [March 8, 2020, 8:03am UTC](https://forums.unrealengine.com/t/how-do-i-get-a-cpp-class-into-another/462198/2 "2020-03-08T08:03:57Z")

</div>

Hi,

I think the Ground\_Proximity\_Check\_Actor should be set up as an Actor Component; not as an Actor.  
You can then reference it into the Ground\_Setup…

---

<div class="post-metadata">

**Author:** ![icroiant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@icroiant](https://forums.unrealengine.com/u/icroiant)\
**Post date:** [March 9, 2020, 1:49am UTC](https://forums.unrealengine.com/t/how-do-i-get-a-cpp-class-into-another/462198/3 "2020-03-09T01:49:29Z")

</div>

Changing the billboard actor into a component would be a good idea. If somehow you need it to be an actor, use the UChildActorComponent.
