Hey I am creating a 2d platformer game by using tilemaps. For the enemy I tried to create Navmesh according to a tutorial but when I check it by playing it says Navmesh needs to be rebuild and my enemy characters do not move.
Already did that it generates a green colour path but this doesn’t affect any of the ai. I don’t remember what I did but I did made some changes due to which it started working and then some changes again and not working. And I can’t remember what did I do wrong. I tried re building ,replacing,deleting and new Navmesh but nothing seems to work.
I am sure the problem is not of ai it’s of Navmesh.
If you followed the above recommendation it sounds like the nav mesh should be fine and it may be in the changes you made elsewhere. Did you make changes to the way your AI behaves? Posting code from their controller/behavior might help
Yes I made the changes in the ai. Also it knows where the protagonist is and changes its direction but do not move from its place. I will check if there is problem in the code but it is due to Navmesh.
Is there any perticular settings that I should keep of the Navmesh?
Or this is due to version 5.5
Under most circumstances you don’t need to mess with the navmesh settings. It sounds like it’s an issue with your AI, if you can post the code/BP of the AI behavior tree and tasks you may get a faster solution from the community
Not in 5.5 and also for a different reason, but I also remember the navigation being completely broken after changing some stuff in the project settings (couldn’t be fixed after changing everything back, neither after some additional troubleshooting). I think the version was 5.3. Anyways, what happens when you migrate all of your assets to an empty new project? To migrate an asset, you can right click on it on the Content Browser, hover over the Asset Actions option and hit Migrate under the sub-menu. You can also right click on a folder as a whole, in which case the Migrate option won’t be hidden under any additional menus.
Here are the blue prints. If you like i can share the whole project.
I am making this project as base for the actual game that I want to make. This will be a trial. Also this is my major project.
I am uploading the whole project at google drive and it is taking time i will share the link as soon as it gets uploaded
(post deleted by author)
Here is the link for whole project
Yeah, if the green path is generating, then the navmesh is definitely working. The issue is almost certainly in the AI’s movement logic. Maybe something’s blocking the AI physically, or the MoveTo task is failing silently—could be a blackboard key mismatch or the acceptance radius being too tight. Post your behavior tree and any custom task nodes you’re using, someone here will probably spot it quickly.
Forum is not allowing to post more than 1 image at once.
Also acceptance radius is 100.
I will post images one by one in some time then. That’s why I also posted the whole project
I am posting images with the default navmesh settings i have reset them.
Also with default navmesh settings i am not getting a green path when i change collision to blockall or pawn then only it shows green path.
Nothing is catching my eye as catastrophic failure in any of these, there’s a few places where your doing checks and branch decision if returned false for some reason then your AI actor would do nothing, maybe verifying those are all returning what they need to be. You had mentioned the issue you were having is that the AI wouldn’t move to the player. Can you post the “move to” task
I believe I have shared that.
If you don’t mind can you check directly from the project? That would be much easier and I think you will notice the problem immediately.
Hello @Adorare07
I don’t really want to install PaperZD into my engine. That being said, nav mesh requires a surface of some sort to be generated. Right now you’re not generating anything at all, because all you have is one flat tile. Also I could not locate any MoveTo logic, but a lot of things are broken since I don’t have the plugin installed.
If you really want to use Nav Mesh, then my suggestion would be adding a thin surface on which you can actually generate said Nav Mesh (you will know it’s there when you press “P” and a green field appears on the screen.
You can use anything that has some geometry to it (eg. a thin cube). Scale it to cover the entire level or portions of it if you have different height platforms.
I think you would need to set it’s collision to “Block All” and tick box "Can Ever Affect Navigation (static mesh details panel).
This will give you AI a surface to navigate on. I don’t have much experience with 2D stuff, yeah but this will solve your nav mesh problem. I would look up how to make AI’s move in 2D games.
I hope this clears things up a bit.
Some screenshots for reference. Good luck.
PS. You can add multiple screenshots, but you have to do it one at a time. (?)