Ai Move To problem with Lyra Starting Project

Hello,

I’m currently doing a zombie like game with Mario. In my game, I the koopas spawn in many zones and they have to break the window for getting out of there and kill the player.

When I launch the game in the editor in the current map, it works well! (You will have the video). The issue is that when I start the game from another map and then I load this one, the koopas spawn correctly, but they don’t move.

So I checked in the code why. Everytime they activate the function “Ai move to”, it fails. I don’t understand why it doesn’t work. It works when I load the map directly in the editor. So it means that the navmesh works correctly.

I also use the Lyra starter project. Maybe it’s something linked with the replication between the server and the client. The issue also happen when the player is killed and then the level restarts from the beginning. So I don’t think it’s an issue with the server and the client because the setting are supposed the be the same.

Here is the video of the issue:

I hope that you will find my issue

Hello again!

I just found a solution. I don’t think it’s the best solution. So the solution is to activate the option “Force rebuild on load”. I don’t think it’s the best solution because the player needs to rebuild the navmesh each time he loads the game. It’s supposed to be already built.

So the issue is linked to the navmesh. If someone has another solution where the player doesn’t need to build the navmesh each time he loads a level, don’t hesitate to put it here !!! ^^

Hi, are you using a single navmesh for a large map? Also, depending on the shape of your terrain, having a navmesh doesn’t guarantee a valid path between the AI and your player. Press P on the level editor to visualize the navmesh areas. You may need to increase Z scale to fit everything.

For large maps, there’s a blueprint class named “navigation invoker”, actor components that can be added to bots or any other actor in the level. Take a look at these videos below:

How To Use Navigation Invokers In Unreal Engine 4 and 5 (Tutorial) How To Use Nav Mesh On Large Maps (youtube.com)

NavMesh Recast From A-Z; Optimize Your NavMesh & Fix Problem Areas; UNREAL ENGINE (youtube.com)

Hi, thank you for the reply. Yes indeed, I use a single navmesh for a big map. I will check for the navigation invoker. Maybe it’s the solution.

Thank you^^

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.