Setting character to use specific Nav agent

Hi,

I’ve defined 2 Nav Agents in project navigation system settings (and both have auto-generated their associated navmesh bounds volumes in the game map). Both agents have exactly the same sizes (basically same character, different skills), but one can only step up to a height of 40, and the other can step up to a height of 100. If I understand the Navigation system correctly, it automatically chooses which nav agent to use for a character based on the characters size fitting the sizes defined for the nav agents.

So is there a way to hard code a character to use a specific nav agents navmesh? I’ve tried changing his “Character blueprint > Character Movement Component > Details > Nav Movement > NavAgent Step Height” to 50, but he still uses the default agent navmesh.

Any ideas would be great…

1 Like

Hey, sorry to bump, but really need to find an answer to this… :()

Thanks,
Bruce

Any help would be great…

Thanks

Hey sorry to bump but did you ever find a way to use the Nav Agent Properties? If so could you let me know how you got it working?

Hi,

I’m actually trying to solve this issue, too. But I simply can’t figure out how to assign a specific Agent to a character.

I created a new “Default” type (Project Settings -> Navigation System -> Agents) but I just can’t figure out how to actually assign those settings to a specific character :frowning:

Is this even possible in BP?

Hi,

I’ve found a way to work around that, it’s not exactly setting the Nav Agent but it’s a way. In the Character Movement Component, you can use a node called “Set Nav Agent Props” where you can override the settings you need (Nav Agent Radius, Step Height, etc). This will force an update and will adjust the Nav Agent based on the settings you provide. I tried it out with 2 agents a big one with 88 half height and a small with 34. I’ve done the whole thing in BP.

Cheers

CharacterMovementComponent doesn’t have a public property NavAgentProps that I can set (it seems to be protected). How did you do that?

I found the NavAgentProps node, if I create a new blueprint which would inherit from MovementComponent, but that’s not an option unfortunately.

Hey,

Sorry for taking so long, I just noticed that there was a question. Here’s a photo on how to implement it, I call this function on “begin play”.

Hope this helps!

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_195003_1592039697704_93”,“title”:“NavAgentOverride.png”}[/ATTACH]

Hi, could you re-upload that image? Cheers!

Hey, I’m not the most active member huh. Lost the photo but I took a new one!

Hey, could you please post the photo, I think it got lost with the forum update :confused:

Use FNavAgentProperties& UCharacterMovement::GetNavAgentPropertiesRef()

It gives reference to nav agent properties.

In Pawn Class, GetCharacterMovement()->>GetNavAgentPropertiesRef().XXX = value;

Hi,
I’m looking for this setting but can’t find it and nothing in the documentation about nav agents.

Here is everything I have on my movement component :

image

The system doesn’t work the way you would expect it to, and you can’t specify which Agent AI characters use. The best workaround I’ve found is the following:

  1. Right-click in your content browser and create a new blueprint actor of “NavArea” type. Give it a descriptive name for the AI you want to use it like “NPC_XYZ_Area”

  2. Create another BP actor - search for “Nav Filter” in the class search and select “NavFilter_AIControllerDefault”. Give it a descriptive name like “NPC_XYZ_NavFilter”. Open this and add a new array element by clicking on the +. For the AreaClass give it your custom AreaClass you created in step 1. FYI it might not show in the list, but if you select it in the Content Browser and use the Arrow to force it in, it will work.

  3. Open the AIController for your NPC and search for “Nav” in the class defaults. Under Default Navigation Filter Class specify your NavFilter you created in Step 2.

  4. In your level, add a Nav Modifier volume (or several), set it to whatever size you want, and then set its Area Class to match the area class you created in step 1.

  5. Watch as your AI moves only on these volumes and forget about the stupid Navigation Agents system that we can’t control.

3 Likes

Thanks a lot for the procedure!!
Unfortunately I couldn’t make it work, NPCs still roaming in the entire nav volume. I have also tried to use the filter class on nodes, like “move to” in the behavior tree, and “get point in navigable radius” I’m using in AI task. But that makes no effect.

I begin to consider using my own system if I ever go back to this project, there would be only one nav volume, and I would place tagued boxes for NPCs to pick their goal.