Hitting ensure when duplicating BP Actor which has a NavLinkCustomComponent attached

We have a C++ component which extends from `UNavLinkCustomComponent` which essentially just listens for `OnLinkMoveStarted()` and `OnLinkMoveEnded()` and we have exposed that to BP so content creators can add them to a blueprint if desired.

If I make a new blueprint with a mesh (just so we can see it in the editor) and attach one of these custom navlink components, then place one in the world in the editor and duplicate is (Either through alt-drag or copy/paste) then I hit the following assert:

"Ensure condition failed: CustomLink.GetId().IsValid() [File:D:\Perforce\Slumber_Dev\Engine\Source\Runtime\NavigationSystem\Private\NavigationSystem.cpp] [Line: 2960]

UNavigationSystemV1::RegisterCustomLink::<lambda_3>::operator (), registering a CustomLink with an invalid id."

The callstack is as follows:

Error: Ensure condition failed: CustomLink.GetId().IsValid() [File:D:\BuildAgent\work\e036aca36fe06e9c\Engine\Source\Runtime\NavigationSystem\Private\NavigationSystem.cpp] [Line: 2960]

UNavigationSystemV1::RegisterCustomLink::<lambda_3>::operator (), registering a CustomLink with an invalid id.

Stack:

0x00007ff930678864 UnrealEditor-NavigationSystem.dll!UNavigationSystemV1::RegisterCustomLink’::2’::<lambda_3>::operator()() []

0x00007ff93056416f UnrealEditor-NavigationSystem.dll!UNavigationSystemV1::RegisterCustomLink() []

0x00007ff9305439a2 UnrealEditor-NavigationSystem.dll!TWeakBaseFunctorDelegateInstance<UNavigationSystemV1,void __cdecl(INavLinkCustomInterface &),FDefaultDelegateUserPolicy,UNavigationSystemV1::RegisterToRepositoryDelegates’::2’::<lambda_1> >::ExecuteIfSafe() []

0x00007ff9305644ef UnrealEditor-NavigationSystem.dll!UNavigationObjectRepository::RegisterCustomNavLinkObject() []

0x00007ff93056ff85 UnrealEditor-NavigationSystem.dll!UNavigationSystemV1::RequestCustomLinkRegistering() []

0x00007ff930587b7b UnrealEditor-NavigationSystem.dll!FNavLinkCustomInstanceData::ApplyToComponent() []

0x00007ff941f04c5f UnrealEditor-Engine.dll!FComponentInstanceDataCache::ApplyToActor() []

0x00007ff941725073 UnrealEditor-Engine.dll!AActor::ExecuteConstruction() []

0x00007ff9417604d4 UnrealEditor-Engine.dll!AActor::RerunConstructionScripts() []

0x00007ff94174ba7b UnrealEditor-Engine.dll!AActor::PostEditChangeProperty() []

0x0000021b5e16bb69 UnrealEditor-MyGame.dll!AMyGameTraversalActor::PostEditChangeProperty() []

0x00007ff947daac2c UnrealEditor-CoreUObject.dll!UObject::PostEditChange() []

0x00007ff93dae8603 UnrealEditor-UnrealEd.dll!ImportObjectProperties() []

0x00007ff93dae875b UnrealEditor-UnrealEd.dll!ImportObjectProperties() []

0x00007ff93dbebc5b UnrealEditor-UnrealEd.dll!ULevelFactory::FactoryCreateText() []

0x00007ff93d9f9b6e UnrealEditor-UnrealEd.dll!UUnrealEdEngine::PasteActors() []

0x00007ff93da1926d UnrealEditor-UnrealEd.dll!UUnrealEdEngine::edactPasteSelected() []

I tried setting the navlink to have a valid ID before calling Super::PostEditChangeProperty() which makes the ensure get hit less frequently but it still gets hit occasionally.

What is the repercussions of ignoring the ensure? Or is there something I should be doing to stop it from happening in the first instance?

Thanks

[Attachment Removed]

Steps to Reproduce
Make BP Actor with a BP component of type UNavLinkCustomComponent.

Place in world

Alt-Drag a copy or use copy/paste

Observe ensure

[Attachment Removed]

Hi Allan,

Thanks for the information and repro steps.

I was able to reproduce the issue and found that it occurs when extending UNavLinkCustomComponent as a blueprint-spawnable component.

UNavLinkCustomComponent is primarily intended to be used by ANavLinkProxy as a smart link and does not appear to be designed for use as a blueprint-spawnable component. This limitation likely explains the issue you’re seeing, and also be the cause of the CustomLinkId become invalid when the actor is duplicated within editor.

Could you please provide additional context regarding the motivation for exposing OnLinkMoveStarted / OnLinkMoveEnded to content creators? A clearer understanding of the use case would assist us in evaluating the best approach. We could also explore alternative solutions to achieve the same goal, such as UPathFollowingComponent.

Best regards,

Henry Liu

[Attachment Removed]

Hi Allan,

Thanks for providing the detailed context.

For animation-driven movement using NavLinks, have you attempted to use the EventReceiveSmartLinkReached event in a Blueprint class derived from GeneratedNavLinksProxy or ANavLinkProxy? This event is triggered when an AI actively uses a specific enabled NavLink as part of its path, and can be used to implement custom movement logic, such as jumping, sliding, grappling, or other animation-driven behaviors.

If you need to track whether an ANavLinkProxy is enabled, one possible approach is to have the NavLinkProxy broadcast its state changes to nearby actors. For example, you could place an actor that listens for these state change events and then propagates that information to your gameplay systems as needed.

Please let me know if this aligns with your requirements, or if you need further assistance for any of these functions.

Best regards

Henry Liu

[Attachment Removed]

Hi Henry,

We are using a sub-class of the custom navlink as we need to know when the NPCs have started/stopped using the navlink. This is because we are using Mover to move the NPC around the world, but we transition to animation driven movement whilst using the navlinks. We need this to be in Blueprint mostly for convenience, as we also need to query the Blueprint actor to determine if the navlink is enabled/disabled at runtime.

Thanks!

[Attachment Removed]