AI Jump

Hello!

I have Blueprint-only (Version 4.13) sidescroller project which im happy with until now (set up items, currency, movement, menus… - basic functionality of a game).

I have integrated some AI so it runs from point A to B. But it does not jump to a higher ground to continue running / chasing.

I researched that a jump is not doable with blueprints only. So I have tried to follow steps from this guide: A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums1-_Making_AI_Jump_as_a_Part_of_Path_Following

I have also used the code from MieszkoZ github : GitHub - MieszkoZ/AITutorialCPP: Tutorial ground for showing how UE4 AI should be set up and used.

After setting up first class NavArea_Jump .h and .cpp and building it i got some errors but continued. (also used the code from github)

.h

.cpp

Created a new C++ class TutorialPathFollowingComponent inside the engine as described in the tutorial. (also used the code from github)

.h

.cpp

Repeated the same process for the class TutorialAIController. (also used the code from github)

.h

.cpp

In the end I only see the class NavArea_Jump inside the game engine and I also get 4 errors after building in visual studio:

Severity Code Description Project File Line Suppression State
Error (active) identifier “FNavMeshNodeFlags” is undefined AdTycoon e:\AndroidProjects\Unreal Projects\AdTycoon\Source\AdTycoon\NavArea_Jump.h 26

Severity Code Description Project File Line Suppression State
Error (active) identifier “RECAST_STRAIGHTPATH_OFFMESH_CONNECTION” is undefined AdTycoon e:\AndroidProjects\Unreal Projects\AdTycoon\Source\AdTycoon\NavArea_Jump.h 26

Severity Code Description Project File Line Suppression State
Error (active) identifier “FNavMeshNodeFlags” is undefined AdTycoon e:\AndroidProjects\Unreal Projects\AdTycoon\Source\AdTycoon\NavArea_Jump.h 27

Severity Code Description Project File Line Suppression State
Error (active) identifier “FNavMeshNodeFlags” is undefined AdTycoon e:\AndroidProjects\Unreal Projects\AdTycoon\Source\AdTycoon\NavArea_Jump.h 28

Which are following lines in the class NavArea_Jump.h:

    FORCEINLINE bool IsNavLink(const FNavPathPoint& PathVert) { return (FNavMeshNodeFlags(PathVert.Flags).PathFlags & RECAST_STRAIGHTPATH_OFFMESH_CONNECTION) != 0; }
FORCEINLINE bool HasJumpFlag(const FNavPathPoint& PathVert) { return IsSet(FNavMeshNodeFlags(PathVert.Flags).AreaFlags, ENavAreaFlag::Jump); }
FORCEINLINE bool HasCrouchFlag(const FNavPathPoint& PathVert) { return IsSet(FNavMeshNodeFlags(PathVert.Flags).AreaFlags, ENavAreaFlag::Crouch); }

How can I fix it ? I would be thankfull for any hints !

I have also checked the guide from Rama : A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums

But I got it right, that I would need to add a bunch of code to get it work ?

Thank you for reading !

Edit: I put an object beneath the spot i need the AI to jump. Works okeyish , sometimes too buggy though as the AI tries to run back and does not understand its being launched. Not the best workaround though

Bump :slight_smile: Still looking for a proper solution