Make AI move without NavMesh

Hi,
I have a game which uses Procedural Generation for the floor. Every now and then, I have these bots that spawn in order to shoot the player. The problem is, I want to make the bots move a specific units forward before shooting the player.

On searching for an answer, I could only find the use of Navigation Mesh for movement. However, since there is nothing at the start, there is no way of generating a NavMesh.
I tried the ‘Add Impulse’ Node but that pushes the bot endlessly.

Is there a way around it?

3 Likes

You can try something like this, this will move the character 500 units forward.

1 Like

Besides Kaidoom15’s answer, you can create a navmesh that regenerates at runtime.

Check out this thread for more insight.

1 Like

Splines can also be a nice option to define movement paths for characters. These allow movements that are not just linear and can be created on the fly. You even can check for obstacles when creating splines using linetraces and avoid hitting these by adjusting the splines accordingly.

1 Like

Hey, this works!
Is there a way to trigger the bot’s walk animation along with this? The bot seems to hover to the location.

Thank you for your response! I am avoiding using NavMesh altogether since the map size is undeterminable in the start.

Hi there,

Have you tried to use Navigation Invoker? It’s an actor component that generates a navmesh around the NPC, and has configurable options. Also, you need to activate this feature in the project settings and add this component to your NPC blueprints.

3 Likes

Thank you! Really solved a problem I have had for weeks.

I tried it. But somehow the NavMesh is not generated at all, not even around the NPC.

Have you found any tutorial to assist you? I recall there’s a small trick to make it work. Like, you need to add one navmesh and set a few options.

You could have a huge navmesh bounds volume in your level, and switch to navigation invokers in the project settings
image
And then add a navigation invoker component to your base pawn class, and it should work after that

2 Likes