Making an NPC AI move around in UE5?

Hi guys. Im just beginning to learn AI and following a tut, I setup the behavior tree, blackboard, chsracter BP, etc. To make the NPC find a random point within a 1500uu radius around it, wait 2 seconds and repeat.

But the character always just stands there. I’m pretty much 100% sure i did exactly what the tut did, but it uses UE4 and I’m on 5.

Is there something extra or different I gave to do to make this work on 5?

This is the tutorial:

The nav mesh doesnt show a green plane in 5. It just makes the ground darker. Is there some setting in the nav mesh I have to change to make it work?

Other than that this should definitely work.

Anybody have any ideas?

Thanks





Hi there,
Have you assigned the AI controller to your enemy character?

On your blackboard tree, select the node “move to” and go to the right panel. Make sure the variable K_TargetLocation = Vector, not “self actor” as default. You need to make sure the names always match up.

1 Like

Hi, yes I assigned the AI controller. Which part is this In, blackboard or behavior tree? Thanks again.

Oh those are all set to K_Target Location.

Could it be an issue with the nav mesh? It works for the guy I’m following and I did exactly what he did. Could it be something about ue5 since I’m using it and he uses 4?

Did you add the NavMesh? Can you create a new project from the ThirdPerson template and copy these files into it?

I did add a navmesh. Is it supposed to be black instead of green in UE5? Every video I see it’s green. And does it have to be the third person template? I think mine is the first person one. I’ll try this out, but I’d really like to find out what went wrong. Thanks a ton for yhe link!

Hey again @BO-DACIOUS! So you already mentioned the navmesh view acting funny, could you enable it and show us how it looks on your ground? Does the Nav mesh volume cover the entire zone? Are your blackboard events firing? (try to print something when attempting to do things, might give us an idea of where things are failing)

It should definitely be green like this: Red if it’s got an issue or is loading.

Hi, so this black square us my navmesh. This is UE5. Never seen it black before. Every node in that image of the BTTask blueprint fires successfully over and over. So what do you think about all of that?

Thanks

I’m also testing in UE5, I’ve also never seen it in black. You can actually change the color of the navmesh in it’s settings but assumedly you haven’t. Let’s test the navmesh itself. Pop 2 of these bad boys in your scene at different locations in the nav mesh and see if they can path to each other. (They don’t actually walk they just show the path they would take)

Hey yeah I dropped two of those down and to me it looks like something wrong. Here’s a shot if what I see.

If I stop replying its because I’m starting to fall asleep. Long stressful day of trying to find out why things don’t work. But please reply because this is very important to me. And I will 100% reply tomorrow. I really appreciate this.

Hi there,

Select the navmesh and pres P. It should turn green. Press again to disable the color.

Support: I was wrong. I had to check a box to make them work and they found each other. Now I’m completely confused. I’ll reply to you asap tomorrow. Thanks

Hey, yeah when I press P it turns black. Not green. I don’t know why.

Can you please record a short video clip showing your setup? Navmesh Bounds Volume, NPC, AIController, Blackboard, Behavior tree and tasks.

I can try tomorrow for sure. I can’t seem to record smooth videos of UE5 but I’ll try my best. I’m just starting to fall asleep so I’ll reply tomorrow. Thanks again

@BO-DACIOUS All good, so since we know it’s not the navmesh, we’re gonna have to look through everything like LFA mentions, a video would be best, decent quality if you can.

Character BP
NavMesh Bounds Volume Settings (and how it looks in general)
AI Controller
Behavior Trees and Blackboard
etc.

Edit: also had an issue recently that was that their world was world partitioned and that caused an issue with the navmesh Simple Ai Not Moving? - #16 by KinGxSeGaL1 This is likely not your problem but I figured I’d mention it for the sake of it.

As much as you can show that’s relevant. Enjoy your sleep!

Hey guys. Here’s the video you wanted. If you need to see anything else let me know. Did you read anything about the black nav mesh?

Thanks guys

Thank you for sharing this video.
Two questions here:

  1. Are you spawning your NPCs or placing them in the world?

  2. Have you assigned the Blackboard as a variable of your Behavior tree?

Also, I learned from another source that sometimes, you need to disconnect the behavior tree nodes and connect them again, not sure if this sort of bug still persists. Maybe you want to try that as well.

Hi, I just placed them in the world. What node should I use? Spawn actor from class? And in the level blueprint?

Do you mean the blackboard asset? I have my BB set there.

I disconnected ny behavior tree modes and replaced them and that didn’t work. The tut just places the npc In the world too. Somewhere it let’s y.ou pick spawned or placed in a dropdown and I’ve tried all those options. I don’t know why this is so difficult. It was very easy to follow and it should work. This is extremely frustrating.

Is there a way to test which behavior tree nodes are firing andvehich aren’t?