I am completely new to Unreal Engine, and our game needs NavMeshes for AI movement. I tried understanding the official documentation below, but couldn’t understand it clearly.
“Content Examples Sample Project for Unreal Engine | Unreal Engine 5.0 Documentation”
Could anyone break down and describe setting up of NavMesh in UE4 or link me to any other documentation/tutorial that explains it in detail?
Thank you in advance.
Unfortunately the documentation is referring to a slightly older version of that level, and we are working to update that. But the principles are the same.
A Navmesh is set up as a volume. In the Modes tab, select Volumes and then scroll down to Nav Mesh Bounds Volume. Placing one in your level so that your map is within the volume’s bounds will create a NavMesh Actor that you can see in your level if you press P or go to Show and check Navigation to on. The Nav Mesh will be built automatically.
Did you have any specific questions about setting up your Nav Mesh?
Thank you for the answer. I realized I have a even primitive task at hand.
- I want to spawn an AI in-front of the player character,
- get the reference to it,
- and do a simple move task on the AI to a target point defined in the level.
Since am new to UE4, am using “Blueprint only” to do this, and just to be faster I am using the existing “NavMesh” umap from content example . I have attached the screenshot of my blueprint. Here is what is happening,
- The new AI (Existing class of the Umap) is being created at desired location,
- return value of the spawn does not give any reference to the controller, I even tried to set an AI controller, which I am not sure if I should be doing.
- And I assume that is the reason the Simple move function is not working.
If anyone sees an obvious mistake kindly help me out.
Found the answer to my problem, Apparently I had to spawn default controller along with AI. The below Blueprint works and does what I want to.