I’m working on a 3D TD which requires the player to use a drawing system to create barricades for blocking enemies’ path.
I have a Recast Graph and I would like to update the graph attaching NavMeshCut component to each box collider forming a drawn object. As you can see in the image, a drawn object consists of a set of collider boxes.
My problem is that NavMeshCut component uses a 2D shape to cut the navmesh with. As specified in documentation, if I rotate the object to which NavMeshCut component is attached that shape will be just projected down on the XZ plane, cutting the graph in an unwanted way.
To clarify, here is the result on the navmesh. As you can see in the image below, the graph is badly cut where a collider box is rotated, so enemies can pass through the object.
How can I make a moving and rotating box collider cut the navmesh in real time, according to its position and volume? Maybe using Recast Graph and NavMeshCut isn’t the best solution for me, but I don’t know what else to use to solve my problem.
My version is 4.1.12.
Any help is really appreciated. I’m still a newbie in coding and this is my first project, so examples are really welcome Please tell me if you need more specific details.
Thanks in advance!