![]() Fortunately, Unreal Engine provides us with the incredibly useful Nav Link Proxy Actor. Our next challenge is to add the ability for the AI to "drop" from one part of the NavMesh to another part, without having to go around.īasically, we want to create a 'link' from one predetermined point on the mesh to another, which the underlying algorithm can't find by itself. There is a simple fix for now, just restart the editor and move your nav area slightly to force a rebuild! You should then see your stairs highlighted in your chosen colour - showing that the area has been applied properly. The moment we do that, however, the stairs go back to green! This is because there is currently a bug in UE4 regarding custom Nav Areas. Lets change it to our Nav Area that we created: This is because the Area Class is set to NavArea_Null. When you first drag one onto the stairs, you'll notice that it actually deletes the NavMesh! The main method for marking a space in your game as a specific Nav Area is the Nav Modifier Volume. Nav Areas can be applied in a few different ways. Note: if you want to do this in C++, I'm sure you can figure it out! Just subclass the UNavArea class and set the values you'd like in the constructor. ![]() Lets create a NavArea_Stairs and set the Default Cost to 1.2, and the colour to a yellow/orange. The Default Nav Area class uses a light green, and visualising where the other areas are can help our level designers. This is multiplied by the distance that the AI would have to walk through the area, so higher numbers cause the AI to avoid that zone.įixed Area Entering Cost can be used for things like the "oil spills" in Divinity: Original Sin, that apply a status effect when you first enter the zone.Īlso, we can edit which colour is used to represent the Nav Area. Once we've created an area, we can tweak a few simple settings (C++ can do a lot more, but we'll cover that later).ĭefault Cost is used to make walking through an area be more or less attractive. We can create our own areas the same way we create any class (in either Blueprints or C++): Unreal Engine uses the concept of a Nav Area for this. We could make it "heavier" or "lighter" than the rest of the map to create preferences. If we wanted the AI to avoid certain areas, we would need to make it "cost" something to enter or to traverse the area. The AI only ever considers distance when determining what path it wants to take. Nav Areasīefore we start making anything, we'll begin by discussing the idea of navigation areas.īy default, all areas of a NavMesh are entirely equal. The next post includes an updated version of the project. This post will continue to use 4.17, although according to commenters there will be no issues with following along in 4.18. Note: Unreal Engine 4.18 was released while this blog post was being written.
0 Comments
Leave a Reply. |