How do I spawn a Nav Modifier within the Editor in C++?
I want to create a tool that allows me to string together nav modifiers on a map in the editor. Think of the spline component but I'm just making rectangular nav modifiers that touch tip to tail based of the points you've created. I've already set up a NavRoad component and NavRoad component visualizer, but I'm not sure how to actually spawn an object in the editor that can affect the nav mesh with a given custom UNavArea. Does anyone know how I can do this?
I've read that you can't just spawn regular nav modifiers so I created my own class that I want to spawn, but I'm not sure what I should derive from for them to affect the nav mesh.
This is all done in C++ and any help would be really appreciated!!
asked Jan 08 '19 at 12:22 AM in C++ Programming
So I was able to do this by having a base AActor class that holds a USceneComponent, which deals with spawning all the UBoxComponents. I have the USceneComponent so I can attach a component visualizer attached to the hole thing. The AActor also holds a UNavModfierComponent which basically looks at all the volumes connected to the AActor (the UBoxComponents) and modifies the nav mesh based on them.
Also something to note is that when you create the UBoxComponents within the editor, in order to make them visible and actually connected to the AActors component list, you have to call RegisterComponent() on the newly created UBoxComponent.
If you have any questions feel free to comment and ask
answered Jan 10 '19 at 06:42 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here