Навмеш препятствие (Navmesh Obstacle)
The NavMesh Obstacle component allows you to describe moving obstacles that the agents should avoid while navigating the world. A barrel or a crate controlled by the physics system is a good example of an obstacle. While the obstacle is moving the agents do their best to avoid it, but once the obstacle becomes stationary, it will carve a hole in the NavMesh so that the agents can change their paths to steer around it, or if the stationary obstacle blocked the pathway, the agents can find a different route.
Свойство: | Функция: |
---|---|
Shape | The shape of the obstacle geometry: capsule or box |
For box | |
Center | Center of the box relative to the transform position |
Size | Size of the box |
For capsule | |
Center | Center of the capsule relative to the transform position |
Radius | Радиус цилиндрического препятствия. |
Height | Высота цилиндрического препятствия. |
Carve | When turned on, the obstacle will carve hole in the NavMesh |
When carving is turned on | |
Move Threshold | Threshold distance for updating a moving carved hole. |
Time To Stationary | The time to wait until obstacle is treated as stationary. |
Carve Only Stationary | When enabled, the obstacle will be carved only when it is stationary. |
NavMesh Obstacles can be used to affect the agent’s navigation during the game in two ways:
When the obstacle moves, the carved hole will also move but to reduce CPU overhead the hole is only recalculated when necessary. The recalculation logic has two options: 1) carve when stationary, 2) carve when moved.