Verse Library verse

02 Get The Navigatable Interface This Allows You To T

Computes a random waypoint for AI agents and generates navigation targets for pathfinding.

extracted-snippets/documentation/en-us/uefn/create-custom-npc-behavior-in-unreal-editor-for-fortnite/02-get-the-navigatable-interface-this-allows-you-to-t.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/create-custom-npc-behavior-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/uefn/create-custom-npc-behavior-in-unreal-editor-for-fortnite.md
# Section:    Get the Navigatable Interface, this allows you to tell it to move.
# Create a random offset from the spawn point to walk toward.
GoToPoint := NPCSpawnPoint + vector3{X := GetRandomFloat(-DistanceFromSpawnPtToMove,DistanceFromSpawnPtToMove),
                                     Y := GetRandomFloat(-DistanceFromSpawnPtToMove,DistanceFromSpawnPtToMove),
                                     Z := 0.0 }

if(ShowAIDebug?):
    Print(my_first_npc_behavior_message_module.OnNavigateBeginMessage(Agent,GoToPoint.X,GoToPoint.Y,GoToPoint.Z), ?Duration := AIDebugDrawTime)

# Create a navigation target from these two positions that the navigation interface can use.
NavTargetStart := MakeNavigationTarget(GoToPoint)
NavTargetEnd := MakeNavigationTarget(NPCSpawnPoint)

Comments

    Sign in to vote, comment, or suggest an edit. Sign in