I made a custom NavArea to have my AI jump with nav links however I don’t know what is going on with it right now. I have a custom path following component that checks the area flags and will do something if jump is one however instead of it detecting the are of having a flag of 2 it thinks the flag is 0. The real quicker is that it was working when I loaded up the editor however after a build and a compile it stopped working. Here’s the code:
UNavArea_Jump.h
UCLASS()
class PW_GAME_API UNavArea_Jump : public UNavArea
{
GENERATED_BODY()
UNavArea_Jump(const FObjectInitializer& ObjectInitializer);
public:
enum AI_Path_Choice
{
Jump = 1
};
};
UNavArea_Jump.cpp
UNavArea_Jump::UNavArea_Jump(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
AreaFlags = (1 << AI_Path_Choice::Jump);
}
Heres the PWPathFollowingComponent.cpp
void UPWPathFollowingComponent::SetMoveSegment(int32 SegmentStartIndex)
{
Super::SetMoveSegment(SegmentStartIndex);
UE_LOG(YourAI, Warning, TEXT("Set Move Segment Reached"));
const uint16 AreaFlags = FNavMeshNodeFlags(Path->GetPathPoints()[SegmentStartIndex].Flags).AreaFlags;
const uint16 JumpFlag = uint16(1 << UNavArea_Jump::Jump);
FString checkAreaFlags = FString::FromInt(AreaFlags);
FString checkJumpFlag = FString::FromInt(JumpFlag);
UE_LOG(YourAI, Warning, TEXT("Area Flags: %s% / JumpFlag: %s%"),*checkAreaFlags, *checkJumpFlag);
if ((AreaFlags & JumpFlag) != 0)
{
//Jumping code for path finding
UE_LOG(YourAI, Log, TEXT("Jump Flag Hit"));
}
}
and heres a screenshot of the output log and the navlink selected in the details panel