How can I add components in Construction Script?

Hi :slight_smile:

I have to add components in my Construction Script in C++, but I don’t know how to do this.
I’m overriding:

void ATowerVisuals::OnConstruction(const FTransform& Transform)

I guess I should use function AddComponent, but I don’t know how.

Any help would be appreciated. :slight_smile:

I found a solution to my problem. :smiley:

Instead of creating new components in construction script, I create subobject in constructor and then just select proper mesh in Construction Script.

Can your solution be also answer to my question “How to make separate actors via Construction Scripts?”?

https://answers.unrealengine.com/questions/60041/videobphow-to-make-separate-blueprints-via-constru.html

https://forums.unrealengine.com/showthread.php?12413-Video-BP-How-to-make-separate-Blueprints-via-Construction-Scripts