Time for an embarassing question: How to properly add a component using blueprints

Hello Unreal-ites,

I’m trying to add a Text Render component at runtime. In Blueprints, there is a node called AddTextRenderComponent node. Using automatic (not checking bManualAttachment) doesn’t seem to do anything, and using manual by dragging off the output result (the Text Render Component) and choosing AttachToComponent (the one that has you supply a parent). I supply any component in my actor (scene root or box collision) as its parent, but nothing shows up in the Actor’s hierarchy.

-Erol

Attach to component works at run time - Ergo - you won’t see stuff in editor. (something I would really love for the Epic team to change when using Bluetility actions!)

I would just add and keep the component always present in the BP and update / hide / as needed.

But, should you really want to attach stuff at run-time (why?)

After that, the correct attach to component node (there are several depending on if you are attaching to or from) will correctly attach the component.

The component by default seems to face the X axis. if your BP actor is rotated, this text is 2d and it won’t necessarily always be visualized. If your component has rotation this may also get confusing.
Additionally, because of attachment any scaling/transform on the component you attached to is passed onto the text. (so if I attach to a sphere with .01 x / y / z scaling I’ll never see the text.

Hi [USER=“3140864”]MostHost LA[/USER] I really appreciate you responding. I did not know that components spawned in at run time were not available to show in the editor in the details. I just learned something :slight_smile: I just thought whenever I go attach something, it didn’t work. As far as scaling, I personally never worry about scaling because I ensure scaling is appropriate for any object before importing. If it’s an engine based component (one that comes with the engine), if its size needs to be manipulated, Epic was smart to include sizing properties for them, instead of using scale, probably for the very purpose you outlined.

Do you know if the documentation contains any information about runtime component additions do not show up in the editor?

-Erol

The docs are very sparse on it.
But this has been the case for the last 4 engine versions consistently.
My ocean works by generating components in editor via Bluetility. Those components are there visually, but they arent added into the blueprint list of components.

To get around it, I eventually manually added 177 or whatever components and modified the script to move them around appropriately.
This didnt change performance one bit, so I reverted to the component created way for ease of use. (Though it does affect editor performance when working on the blueprint, the positioned component way is more engine friendly).