Question: Blueprint Corruption, missing Components

I’m really getting to the end of my witts here…

I feel like I am always constantly having issues with blueprint corruption concerning components derrived from C++ classes. Basically I have Blueprints that derive from C++ classes. But sometimes when I change things about my C++ classes, or recompile my BP classes, maybe because I’ve migrated Unreal Versions, the components don’t get created anymore on spawn.

One example is from my AIController: I have an AHAIController C++ class and some BP children, like my BP_PCAIController. I was debugging weird pathfinding behaviour, and so I wanted to simply exchange the Pathfinding Component from UCrowdFollowingComponent (that I’ve overwritten in the Constructor) to the default UPathFollowingComponent.

From:

AHAIController::AHAIController(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.SetDefaultSubobjectClass<UCrowdFollowingComponent>(TEXT("PathFollowingComponent")))

To:

AHAIController::AHAIController(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)

The BP is still showing the Component, although, with an empty details pannel:

But on play, when the Controller is spawned, the component is missing, and hence a nullptr in C++:
image

Things that seem to fix that is reparenting the Blueprint or creating a new one and substituting the old one. But these solutions usually come with data loss and lots of work. Renaming the Component’s Property also works, although thats impossible for components like this, that are derived from Engine Classes.

I do not work with hot-reload as I am aware of the issues it can cause. I work with live coding, always close the editor before compiling.

How can I fix these issues, where do they come from, is there some way possible to completely rebuild the BP to fix this?
It can’t be the norm to recreate or reparent the BP avery time something changes about the parent C++ components, and transfer all the default values across and fix the graphs.

1 Like

Nothing to add but “me too”. Every time I reopen the editor I have to invoke a compile and visit EVERY blueprint I’ve created and re-add all the components. It’s unworkable.

Once I add any c++ classes I always run my project from my IDE (usually without debugging). Every since I’ve gotten into the mindset to just run it from the compiler, I’ve never had missing parent classes or problems.

1 Like

This is still an issue I commonly run into in 5.2. Anyone find a fix for this?

My entire team runs into this in 5.2 it’s debilitating. I build exclusively from the editor, but my teammates don’t always. None of us use the Live Coder, but we’re often times in different editor builds (i.e. Debug Game vs Development Editor).

Maybe github’s merge conflict auto-resolve could be at fault? Sometimes that destroys blueprints.

I’ve noticed reparenting blueprints or recreating them entirely is a temporary work around, but eventually things break again.

For us the parent’s components are all fine, but its children aren’t. It’s usually one or two components that break, everything else is fine.

I really don’t understand why the unreal team can’t go the route of caching the built classes once the compile is done and then using these classes in editor. They would always be accessible in editor and only updated on build. Then there wold be no missing classes even if you didn’t run it from the IDE.

Seems like a logical way of doing it. (you’d think that’s what the .generated files are)

I never did any merging as I am on a solo project, so unlikely…