# "Failed import" for subcomponent on editor load

**URL:** <https://forums.unrealengine.com/t/failed-import-for-subcomponent-on-editor-load/317860>\
**Category:** C++\
**Tags:** bug, unreal-engine, bug-report, Scripting, CPP, question\
**Created:** [May 8, 2015, 5:50am UTC](https://forums.unrealengine.com/t/failed-import-for-subcomponent-on-editor-load/317860 "2015-05-08T05:50:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohoon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rohoon](https://forums.unrealengine.com/u/rohoon)\
**Post date:** [May 8, 2015, 5:50am UTC](https://forums.unrealengine.com/t/failed-import-for-subcomponent-on-editor-load/317860/1 "2015-05-08T05:50:51Z")

</div>

I have a custom `USceneComponent` subclass that creates and attaches a `UStaticMeshComponent` to itself in its constructor.

I’ve attached this component to a Blueprint actor and placed an instance in the level. When I reload the editor, I get the following message (class names changed):

**Failed import for MyCustomUSceneComponent /Game/Blueprints/BP\_MyCustomActorSubclass.Default\_\_BP\_MyCustomActorSubclass\_C:DefaultCustomUSceneComponent**

- Engine version:4.7.6
- Platform: Windows 8.1 x64

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [May 13, 2015, 6:24pm UTC](https://forums.unrealengine.com/t/failed-import-for-subcomponent-on-editor-load/317860/2 "2015-05-13T18:24:15Z")

</div>

Hi ,

Could you provide me with the code files associated with making this custom USceneComponent? I’m not sure if it would be a problem with the code itself or the file hierarchy, but this would be a good place to start.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [May 19, 2015, 3:47pm UTC](https://forums.unrealengine.com/t/failed-import-for-subcomponent-on-editor-load/317860/3 "2015-05-19T15:47:27Z")

</div>

Are you still experiencing this issue ? If you could provide me with the files requested in the previous comment, I’d be glad to help you with this problem.

---

<div class="post-metadata">

**Author:** ![rohoon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rohoon](https://forums.unrealengine.com/u/rohoon)\
**Post date:** [May 20, 2015, 12:58am UTC](https://forums.unrealengine.com/t/failed-import-for-subcomponent-on-editor-load/317860/4 "2015-05-20T00:58:51Z")

</div>

Hi ,

Apologies for not getting back to you. Although I’m quite sure that this issue is caused by creating/attaching subcomponents within the constructor of other components (as opposed to in the constructor of the root Actor), I haven’t got a firm grasp of exactly _when_ this issue crops up. It seems to happen every now and then when I open the editor, but tends to disappear for multiple editor opens/closes before cropping up again.

When it does happen, I’m unable to save any changes to that asset. I can’t remember the exact message, but it’s the “Graph is linked to an object in an external package” one.

This sample project occasionally shows the error, but as I said I haven’t been able to ascertain a consistent trigger for it. Perhaps try adding some instances of my test Blueprint actor in this project, closing the editor, then making some code changes and reopening the editor.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [May 21, 2015, 2:13pm UTC](https://forums.unrealengine.com/t/failed-import-for-subcomponent-on-editor-load/317860/5 "2015-05-21T14:13:18Z")

</div>

From what I can see, it seems like this issue is related to one of your other questions: [Editing properties of subcomponents does nothing - Programming & Scripting - Epic Developer Community Forums](https://answers.unrealengine.com/questions/226256/editing-properties-of-subcomponents-does-nothing.html)

It seems as though the hierarchy of your components and the way their being created is causing this issue. If thats the case, then it is closely related to the bug that was entered on behalf of that other question (UE-15271). I can’t think of any workaround for the moment other than possibly replacing the instance that isn’t able to be saved with a new instance. It’s possible that the new one may be able to be saved.
