"Failed import" for subcomponent on editor load

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

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.

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.

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.

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

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.