This component is placed on the navigation mesh of the scenario to block the movement of navmeshagent. Take unity4.3.4 as an example.
Navmeshobstacle can be divided into two modes: one is normal mode, And a range is determined by setting the radius and height to drag the navmeshagent to move, and the other is the carve mode, based on the model size, a "hole" is dug out to eliminate the navigation mesh within the model range, so that navmeshagent cannot pass through the sub-region.
You can set the following attributes:
RADIUS: radius
Height: Height
Move threshold: When the mode is carve, the current navigation grid (new hole) is updated when the movement distance of this object exceeds this threshold value ).
Carve: whether to enable the mode of digging holes in the navigation grid.
Summary of the carve model:
- In the bake scenario, the bake page of the navigation window has a height value. The navigation grid in the scenario is usually used as a plane. When the navmeshobstacle distance is smaller than this height, it will be dug in the navigation mesh, otherwise, navmeshobstacle still exists in normal mode.
- When creating navmeshobstacle, it is best to disable the navmeshobstacle component first, but you need to open it again. Otherwise, there will be a bug (create navmeshobstacle first, and then add ditive scenario, there is always an inaccessible area in the scenario ). After the component is created, move it to the appropriate location and then activate the component.
- Collision or trigger
- It is best not to use Rigidbody at the same time. If there is a bug, the new version may be changed. Refer to the link.
- The device frames are obviously dropped when a hole is dug. Make good use of move threshold.
How to Use navmeshobstacle in Unity