Simple AI leaving Nav Mesh Boundary?

Hi,

I’m trying to make a square move to the player when the player lands on its space.
My issue is that the Square somehow senses the player well below the nav mesh and leaves it to chase the player.


For troubleshooting I have most of the settings for Recastnavmesh lowered and I still get this effect.
Screenshot 2023-03-01 210341

Any help would be greatly appreciated!

Hey @Daisyahoy!

I think this might be an issue with the actor’s movement component rather than the navmesh. Is it using the pawn movement component? Character movement component? On either of those, is flying set to “On”?

Are you using Simple Moveto?

Could you go ahead and just snip the movement code you have, if you’re not using a movement component? That way we could get a closer look. :slight_smile:

@Mind-Brain Thanks for the advice. When I get off work tonight I will be sure to get this information to you.

@Mind-Brain My cube has Floating pawn movement. My AI blueprint is using “move to”


“Can fly” is unchecked in the movement component.

Ah, I see. So the next thing I’m going to ask you is, can you check your collision settings for both the actor and the platform? It seems to me like they are set to overlap or ignore to each other. If the actor is “Pawn” make sure the platform is set to Block “Pawn.” If it’s dynamic, make sure the platform blocks “Dynamic.” etc.

@Mind-Brain Thanks for your help.
Here is collision for the platform.


and here is the Pawn
Screenshot 2023-03-03 171604

Platform is set to pawn but it still seems to go through it.
Its also still strange that the AI NavMesh is limited to the area of the platform but I am being detected from outside of its bounds.

Ah, so you need to set the platform to “Static”. You can use the arrow next to “Collision Presets” to customize what each collision reaction is. Your pawn should be set to “Pawn” and your platform “static.”

Now as far as detection goes, you don’t have any form of detection coded. It’s just getting two locations, and moving, the way it’s coded. If you want to be unseen, you might consider adding a “Line Trace By Channel” and drawing a line between the player and this pawn, then only executing movement if the trace is blocked first by the player and nothing else.

The Navmesh has nothing to do with detection, it’s only supposed to show AI where they can move.

Silly question. How does one “set the pawn to pawn”?

Okay, so. First, you’ll select the root component (The topmost component in your components window on your pawn). Next, go to your details panel, and for “Collision presets” Set the drop down to pawn, like you already have done for the platform. Then do the same for the platform, but set it to static :slight_smile:

Screenshot 2023-03-03 212307
Screenshot 2023-03-03 212233
Here is what I have. In the top right the parent class says “pawn”.

EDIT*****
Sorry i guess I should have clocked on the CUBE. in there I see the collision options.

@Mind-Brain So here is what they look like currently.


Okay! That looks good, and it’s still just moving through?
Let me ask this, I know your platform has a collision box, does your cube pawn? Is it using a static mesh? If so, open the static mesh (Not the actor, the mesh) and go up top to collision → auto generate collision, save it, and then test the game.

@Mind-Brain Thanks for all your help. My collisions were somehow a mess with testing different things.

1 Like