Path Following Component null after conversion to 4.17

Hello, i’ve recently updated to 4.17 and the first thing i’ve noticed is that my AI just crashes because the path following component is null, any idea of why this is? I’ve debugged the code and he’s able to instantiate the path following component on the constructor, but for some reason it gets null after that.

Are you still having this issue?

I had a similar problem just a second ago, but with a BoxComponent. It helped me to comment/remove the UPROPERT() macro from the variable, then rebuild, then start the editor/game → now the component is not reset to null any longer.

I was then able to uncomment/re-add the UPROPERTY() macro, and it kept working.

I have no Idea what the issue was.

Thanks for the reply, i just recreated the blueprint and it worked :slight_smile:

I have had the same issue yesterday.

As soon as my NPCs received a MoveTo command, the Editor crashed with 100% repro rate. I work on a Windows machine and on a MacBook. Only the Windows machine (4.17 → 4.17.2) had the problem, MacBook (4.17.1) worked fine. The project was up to date with our repository in both cases and had no local changes.

I have traced the problem up to here:

void FObjectInitializer::PostConstructInit()
	if (bShouldInitializePropsFromArchetype)
		UClass* BaseClass = (bIsCDO && !GIsDuplicatingClassForReinstancing) ? SuperClass : Class;
		if (BaseClass == NULL)
			BaseClass = Class;
		UObject* Defaults = ObjectArchetype ? ObjectArchetype : BaseClass->GetDefaultObject(false); // we don't create the CDO here if it doesn't already exist
		InitProperties(Obj, BaseClass, Defaults, bCopyTransientsFromClassDefaults);

The InitProperties call copies values from the default object into the actual instance. And at that point my instance Obj had a non-null PathFollowingComponent after creating it inside its constructor, but the default AIController Defaults had it set to null.

I tried debugging a newly created empty AIController to that point, and its default PathFollowingComponent was non-null, so everything worked as expected.

And the last thing I did was check a normal clean blueprint against my broken AI Controller using the property editor.

Here’s a normal one:

Here’s my, broken one:

So in the end it seems that somehow my blueprint got corrupted and lost its default PathFollowingComponent value. I didn’t find a way to restore it (I didn’t try too hard), so I also recreated the AIController blueprint, and now it works fine.