pub struct NavMeshObstacle {
pub m_Enabled: u8,
pub m_GameObject: PPtr,
pub m_Carve: Option<bool>,
pub m_CarveOnlyStationary: Option<bool>,
pub m_Center: Option<Vector3f>,
pub m_Extents: Option<Vector3f>,
pub m_Height: Option<f32>,
pub m_MoveThreshold: Option<f32>,
pub m_Radius: Option<f32>,
pub m_Shape: Option<i32>,
pub m_TimeToStationary: Option<f32>,
}Expand description
NavMeshObstacle is a class of the Unity engine since version 4.0.0. Exert from Unity’s scripting documentation: An obstacle for NavMeshAgents to avoid. A NavMeshObstacle is cylindrical in shape and can move around the surface of the NavMesh with a specified velocity. By default, the obstacle will only affect the agent’s avoidance behaviour rather than the pathfinding. This means that the agent will ignore the obstacle when plotting a path but will sidestep around it while moving along the path. If carving is enabled, the obstacle will create a temporary “hole” in the NavMesh. The hole will be recognised by the pathfinding, so paths will be plotted to avoid the obstacle. This means that if, say, an obstacle blocks a narrow gap, the pathfinding will seek an alternative route to the target. Without carving, the agent will head for the gap but won’t be able to pass until the obstacle is clear.See Also: NavMeshAgent.
Fields§
§m_Enabled: u8Enabled Behaviours are Updated, disabled Behaviours are not.
m_GameObject: PPtrThe game object this component is attached to. A component is always attached to a game object.
PPtr<GameObject>: (4.0.0 - 2022.3.2f1)
m_Carve: Option<bool>bool: (4.3.0 - 2022.3.2f1)
m_CarveOnlyStationary: Option<bool>Should this obstacle be carved when it is constantly moving? bool: (5.0.0f4 - 2022.3.2f1)
m_Center: Option<Vector3f>The center of the obstacle, measured in the object’s local space. Vector3f: (5.0.0f4 - 2022.3.2f1)
m_Extents: Option<Vector3f>Vector3f: (5.0.0f4 - 2022.3.2f1)
m_Height: Option<f32>Height of the obstacle’s cylinder shape. f32: (4.0.0 - 4.7.2)
m_MoveThreshold: Option<f32>f32: (4.3.0 - 2022.3.2f1)
m_Radius: Option<f32>Radius of the obstacle’s capsule shape. f32: (4.0.0 - 4.7.2)
m_Shape: Option<i32>The shape of the obstacle. i32: (5.0.0f4 - 2022.3.2f1)
m_TimeToStationary: Option<f32>f32: (5.0.0f4 - 2022.3.2f1)