Custom Navigation Areas and Query Filters Preparation Guide

This guide covers the preliminary steps needed to learn about Custom Navigation Areas and Query Filters.

Choose your operating system:

Windows

macOS

Linux

Overview

This document will guide you through the preliminary steps of creating a Level and AI Agent to learn about the Custom Areas and Query Filters in the Navigation System.

You can also download the full sample project , which includes all the material covered in this guide.

Objectives

  • Create a new Level and set up navigation by placing a Navigation Mesh Actor in the Level.

  • Modify the ThirdPersonCharacter Blueprint to navigate toward its target by using specific Query Filters.

1 - Required Setup

  1. In the New Project Categories section of the Unreal Project Browser, select Games and click Next .

    Create-Project.png

  2. Select the Third Person template and click Next .

    Create-Project2.png

  3. Select the Blueprint and No Starter Content options and click Create Project .

    Basic-Create-Settings.png

Section Results

You have created a new Third Person project and are now ready to learn about creating Area Classes and Navigation Query Filters.

2 - Creating Your Test Level

  1. Click File > New Level on the Menu Bar.

    New-Level.png

  2. Select the Default Level.

    Select-Level-Template.png

  3. Select the Floor Static Mesh Actor in the World Outliner and on the Details panel, set the Scale to X = 10, Y = 10, Z = 1.

    Create-Floor1.png

    Create-Floor2.png

  4. Go to the Place Actors panel and search for Nav Mesh Bounds Volume . Drag it into the Level and place it on the floor mesh.

    Custom-NavMesh-Drag.png

  5. With the Nav Mesh Bounds Volume selected, go to the Details panel and set the Scale to X = 5, Y = 10, Z = 1.

    Custom-NavMesh-Scale.png

  6. Go to the Place Actors panel and go to the Basic category. Drag a Sphere Actor into the Level.

    Custom-Sphere-Drag.png

Section Results

In this section you created a new Level and added a Navigation Mesh and a Sphere Actor. You are now ready to create an Agent that will walk toward the sphere goal.

3 - Creating Your Agent

In this section you will create an Agent that navigates to its target Actor.

  1. In the Content Browser , right-click and select New Folder to create a new folder. Name the folder NavigationSystem .

  2. In the Content Browser , go to ThirdPersonBP > Blueprints and select the ThirdPersonCharacter Blueprint. Drag it to the NavigationSystem folder and select the option Copy Here .

    Move-Blueprint.png

  3. Navigate to the NavigationSystem folder and rename the Blueprint to BP_NPC_CustomZone . Double-click the Blueprint to open it and go to the Event Graph . Select all input nodes and delete them.

  4. Right-click the Event Graph, then search for and select Add Custom Event . Name the event MoveNPC .

    Custom-Event.png

  5. Go to the My Blueprint panel and click the Add (+) button next to Variables to create a new variable. Name the variable Target .

    Custom-NPC-Target1.png

  6. Go to the Details panel and click the Variable Type dropdown. Search for Actor and select the Object Reference . Enable the Instance Editable checkbox.

    Custom-NPC-Target2.png

    Custom-NPC-Target3.png

  7. Drag the Target variable to the Event Graph and select the option Get Target . Drag from the Target node, then search for and select the Is Valid macro, as shown below.

    Custom-NPC-IsValid.png

  8. Right-click the Event Graph , then search for and select Get reference to self .

    Custom-NPC-Self.png

  9. Drag from the Self node, then search for and select Get AIController .

    Custom-NPC-AIController.png

  10. Drag from the AI Controller node, then search for and select Move to Actor .

    Custom-NPC-MoveToActor.png

  11. Connect the Is Valid pin of the Is Valid node to the Move to Actor node. Set the Acceptance Radius of the Move to Actor node to 50. Drag the Target variable and connect it to the Goal pin of the Move to Actor node.

    Custom-NPC-MoveToActor2.png

  12. Right-click the Filter Class pin of the Move to Actor node and select Promote to Variable . Go to the Details panel and enable the Instance Editable checkbox.

    Custom-NPC-Filter1.png

    Custom-NPC-Filter2.png

  13. Right-click the Event Graph , then search for and select Event Begin Play . Drag from the Event Begin Play node and search for and select MoveNPC .

    Custom-NPC-BeginPlay.png

    Custom-NPC-BeginPlay2.png

  14. Compile and save the Blueprint. The final Blueprint should look like the image below.

    Custom-NPC-Completed.png

  15. Drag the BP_NPC_CustomZone Blueprint into your Level. Navigate to the Details panel and click the dropdown next to Target . Search for and select Sphere , as seen below.

    Custom-NPC-Drag1.png

    Custom-NPC-Drag2.png

  16. Press Simulate and watch as your Agent moves toward the Sphere.

    Custom-NPC-Walk1.gif

Section Results

In this section you created an Agent that navigates toward its goal and can use a Navigation Query Filter. You are now ready to learn about adding

[Custom Navigation Areas and Query Filters](InteractiveExperiences\ArtificialIntelligence\NavigationSystem\CustomNavigationAreasAndQueryFilters)
.

언리얼 엔진 문서의 미래를 함께 만들어주세요! 더 나은 서비스를 제공할 수 있도록 문서 사용에 대한 피드백을 주세요.
설문조사에 참여해 주세요
취소