Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] Subcomponents don't appear in Blueprint hierarchy

I have a USceneComponent subclass with a single UStaticMeshComponent attached to it in the constructor. When I add this component to a Blueprint actor, the subcomponent doesn't show up in the Components hierarchy, despite appearing fine in both the viewport and properties window of the parent.

When I drag an instance of this Blueprint into the scene, the subcomponent is present in the hierarchy of the instance and I can move it around without an issue.

  • Platform: Windows 8.1 x64

  • Engine: 4.7.1

Product Version: Not Selected
more ▼

asked May 08 '15 at 01:52 AM in Bug Reports

avatar image

152 16 19 33

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed May 20 '15 at 07:04 PM by Doug E for the following reason:

The question is answered, right answer was accepted

1 answer: sort voted first

Hey rohoon-

Thanks for lettings us know about the inconsistency in the hierarchies. This bug has been reported as UE-15271. Since you are able to access the component in other ways I would continue to do so for now.


Doug Wilson

more ▼

answered May 08 '15 at 03:18 PM

avatar image rohoon May 11 '15 at 01:26 AM

Hi Doug,

A bit of extra information on this issue: I'm actually creating the UStaticMeshComponent in the constructor of the USceneComponent as opposed to creating both in the parent AActor and creating the scene hierarchy via attachments.

I've since been told that this isn't really a supported configuration, and that both components should be created from the AActor's constructor and placed in a hierarchy using AttachTo().

This is probably fine for most cases, but for what I'm doing it presents a bit of an issue, as I want to have pre-defined component types that dictate their hierarchy of child components.

Can you think of some workaround for not being able to create and attach components from within components? Is this planned to be supported at some stage?

avatar image Doug E ♦♦ STAFF May 11 '15 at 02:29 PM

Even though the component created as part of another component class doesn't show up in the hierarchy it is still editable if the base class is used/selected.

For example: If you create a custom SceneComponent class that declares a StaticMeshComponent* and creates the component in the construct, then using that custom SceneComponent in a blueprint you can select the SceneComponent in the hierarchy and make changes to the StaticMeshComponent in the details panel.

avatar image rohoon May 11 '15 at 10:53 PM

Hi Doug,

So you're saying it's OK to create and attach USceneComponent subclasses in the constructors of other USceneComponent subclasses? That is what I've been doing up until now, but it has been causing some pretty serious bugs.

Besides this one, the issues I've been having are:

  1. Having subcomponents created/owned by other components permanently breaks hot-reload (See related question)

  2. Having subcomponents causes ambiguous "Import failed" messages when restarting the editor (See related question)

  3. The child node in a component hierarchy keeps its default property values (set in the C++ constructor) when play begins, instead of using the ones set in either the derived Blueprint or placed instance. (See related question)

If you could take a look at these issues, I'd be glad to help out in whatever way I can. The objects in my project are inherently hierarchical and need to be configurable, and being able to define subcomponents in this way would vastly simplify the design.

avatar image Doug E ♦♦ STAFF May 13 '15 at 05:46 PM

The other errors you reported seem to stem from this (the fact that the components defined in the SceneComponent class aren't showing in the hierarchy). Since the components are still editable if the SceneComponent is selected you can set the properties of the other components as necessary.

avatar image rohoon May 13 '15 at 09:46 PM

The workaround for editing properties of subcomponents is fine for now, I was more wanting to get an official answer on whether creating subcomponents in the constructors of other components is OK or not recommended. Everyone I've spoken to in the IRC chat says to avoid it as it doesn't work properly, but from what you said above, it sounds like that should be a supported configuration.

avatar image Doug E ♦♦ STAFF May 14 '15 at 06:55 PM

As I mentioned in your other post, it would depend on if the components are parents/children of each other or if you are referencing two non-related component. If the components are parented the you only need to add the child to have the functionality of both the parent and child. If they are separate components then declaring a pointer to ComponentB inside ComponentA should work.

avatar image rohoon May 18 '15 at 10:17 PM

Hi Doug,

The child components are not subclasses of the parent components; they're completely unrelated classes. Declaring a pointer to ComponentB inside ComponentA "works", but it causes all of the bugs I linked to in my earlier comment. If you take a look at the sample projects I've attached to those questions, you'll be able to observe these bugs for yourself.

avatar image Doug E ♦♦ STAFF May 19 '15 at 08:02 PM

Hey rohoon-

I tested the sample project you posted with your post and saw the issue with the default not changing with the actor already in the project. When I created a new actor and added the TestComponentA to it I did not have the same issue however. Additionally, seeing that your actor was setup in code it would be a better practice to define pointers to TestComponentA as well as TestComponentB in the actor itself. Then in the constructor you can set one of them as the root component and use AttachTo() to make the other a child in the hierarchy.

avatar image rohoon May 20 '15 at 12:49 AM

Hi Doug,

Please see my comment in our other thread.

avatar image Doug E ♦♦ STAFF May 20 '15 at 07:04 PM

I've responded to your question on the other thread. As these issues seem tied to the same issue I am closing this post in order to focus any other conversation in one location (https://answers.unrealengine.com/questions/226256/editing-properties-of-subcomponents-does-nothing.html)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question