Getting a UNavLinkCustomComponent

Hi There!

I have created a C++ class derived from the NavLinkProxy.cpp and I cannot access the UNavLinkCustomComponent. I really want to get to the LinkRelativeStart and LinkRelativeEnd.

Line as follows:

UNavLinkCustomComponent* MySmartLinkComp = this->FindComponentByClass(UNavLinkCustomComponent)();

The braces around, UNavLinkCustomComponent are < >

The error I get is FindComponentByClass must be derived from UActorComponent.

As far as I can see here: UNavLinkCustomComponent | Unreal Engine Documentation

UNavLinkCustomComponent does derive from UActorComponent! Can anyone help?


I was being an idiot!

This was the solution:


include “Runtime/NavigationSystem/Public/NavLinkCustomComponent.h”


UNavLinkCustomComponent* MySmartLink = GetSmartLinkComp();
MySmartLink->SetLinkData(PointLinks[0].Left, PointLinks[0].Right, PointLinks[0].Direction);