# I can't add a way when the ai reaches the nav link c++

**URL:** <https://forums.unrealengine.com/t/i-cant-add-a-way-when-the-ai-reaches-the-nav-link-c/2452072>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, CPP, Blueprint\
**Created:** [April 12, 2025, 1:39am UTC](https://forums.unrealengine.com/t/i-cant-add-a-way-when-the-ai-reaches-the-nav-link-c/2452072 "2025-04-12T01:39:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Estudiodejogos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Estudiodejogos](https://forums.unrealengine.com/u/Estudiodejogos)\
**Post date:** [April 12, 2025, 1:39am UTC](https://forums.unrealengine.com/t/i-cant-add-a-way-when-the-ai-reaches-the-nav-link-c/2452072/1 "2025-04-12T01:39:59Z")

</div>

Hello everyone I have a problem, I can’t find a way to add an event when the AI ​​reaches the nav link can someone help me?

```auto
#pragma once

#include "CoreMinimal.h"
#include "NavLinkCustomComponent.h"
#include "NavLink_NPC.generated.h"

/**
 * 
 */
UCLASS(ClassGroup = (Navigation), meta = (BlueprintSpawnableComponent))
class STRANGENEIGHBOR_API UNavLink_NPC : public UNavLinkCustomComponent
{
	GENERATED_BODY()
	
public:
	UNavLink_NPC();
protected:
	virtual void OnRegister() override;

	UFUNCTION()
	void HandleSmartLinkReached(UObject* MovingActor, const FVector& DestinationPoint);
public:
};

```

```auto
#include "NavLink_NPC.h"
#include "NavigationSystem.h"

UNavLink_NPC::UNavLink_NPC()
{

}

void UNavLink_NPC::OnRegister()
{
	Super::OnRegister();
}

void UNavLink_NPC::HandleSmartLinkReached(UObject* MovingActor, const FVector& DestinationPoint)
{

}

```

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [April 14, 2025, 3:38pm UTC](https://forums.unrealengine.com/t/i-cant-add-a-way-when-the-ai-reaches-the-nav-link-c/2452072/2 "2025-04-14T15:38:51Z")

</div>

There’s a delegate to bind for this

```cpp
void UNavLink_NPC::OnRegister()
{
    Super::OnRegister();
    SetMoveReachedLink(this, &UNavLink_NPC::HandleSmartLinkReached);
}

void UNavLink_NPC::HandleSmartLinkReached(UNavLinkCustomComponent* ThisComp, UObject* PathComp, const FVector& DestPoint)
{
    //...
}

```
