# What is the properly way to define a component with components attached inside in C++, which would be added on actors in outline, blueprint editor or runtime?

**URL:** <https://forums.unrealengine.com/t/what-is-the-properly-way-to-define-a-component-with-components-attached-inside-in-c-which-would-be-added-on-actors-in-outline-blueprint-editor-or-runtime/583353>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 16, 2022, 12:26pm UTC](https://forums.unrealengine.com/t/what-is-the-properly-way-to-define-a-component-with-components-attached-inside-in-c-which-would-be-added-on-actors-in-outline-blueprint-editor-or-runtime/583353 "2022-06-16T12:26:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![gh0stfase1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gh0stfase1/32/1194639_2.png) [@gh0stfase1](https://forums.unrealengine.com/u/gh0stfase1)\
**Post date:** [June 16, 2022, 2:05pm UTC](https://forums.unrealengine.com/t/what-is-the-properly-way-to-define-a-component-with-components-attached-inside-in-c-which-would-be-added-on-actors-in-outline-blueprint-editor-or-runtime/583353/3 "2022-06-16T14:05:54Z")

</div>

I think I’ve found what we need…

[Dynamically created component not visible/editable in components window - Programming & Scripting / C++ - Unreal Engine Forums](https://forums.unrealengine.com/t/dynamically-created-component-not-visible-editable-in-components-window/438010)

One of the keys seems to be setting the CreationMethod variable on the newly created component to EComponentCreationMethod::Instance. That, coupled with a few other tricks mentioned in the final post should get us to a fully realized solution.

---

_[View the full topic](https://forums.unrealengine.com/t/what-is-the-properly-way-to-define-a-component-with-components-attached-inside-in-c-which-would-be-added-on-actors-in-outline-blueprint-editor-or-runtime/583353)._
