Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    #2
    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?)
    https://gyazo.com/66aae5f769145177b0a3667a64617448

    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.
    https://gyazo.com/0c8ce3ec6fdd222f98350f523a611dd5

    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.

    Comment


      #3
      Originally posted by MostHost LA View Post
      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?)
      https://gyazo.com/66aae5f769145177b0a3667a64617448

      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.
      https://gyazo.com/0c8ce3ec6fdd222f98350f523a611dd5

      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 MostHost LA 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 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

      Comment


        #4
        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).

        Comment

        Working...
        X