Class NavigationComponent
- Namespace
- Stride.Navigation
- Assembly
- Stride.Navigation.dll
This is used to interface with the navigation mesh. Supports TryFindPath and Raycast
[DataContract("NavigationComponent")]
[Display("Navigation", null, Expand = ExpandRule.Once)]
[ComponentOrder(20000)]
[DefaultEntityComponentProcessor(typeof(NavigationProcessor), ExecutionMode = ExecutionMode.Runtime)]
[ComponentCategory("Navigation")]
public class NavigationComponent : EntityComponent, IIdentifiable
- Inheritance
-
objectNavigationComponent
- Implements
- Inherited Members
Properties
GroupId
The navigation mesh group to use
[DataMember(20)]
[Display("Group", null)]
public Guid GroupId { get; set; }
Property Value
NavigationMesh
The navigation mesh which is being used. Setting this to null will load the dynamic navigation mesh for the current game (if enabled)
[DataMember(10)]
public NavigationMesh NavigationMesh { get; set; }
Property Value
Methods
Raycast(Vector3)
Performs a raycast on the navigation mesh to perform line of sight or similar checks. Starts from the entity's current world position
public NavigationRaycastResult Raycast(Vector3 end)
Parameters
endVector3Ending point
Returns
- NavigationRaycastResult
The found raycast hit if Hit is true
Raycast(Vector3, Vector3)
Performs a raycast on the navigation mesh to perform line of sight or similar checks.
public NavigationRaycastResult Raycast(Vector3 start, Vector3 end)
Parameters
Returns
- NavigationRaycastResult
The found raycast hit if Hit is true
Raycast(Vector3, Vector3, NavigationQuerySettings)
Performs a raycast on the navigation mesh to perform line of sight or similar checks
public NavigationRaycastResult Raycast(Vector3 start, Vector3 end, NavigationQuerySettings querySettings)
Parameters
startVector3Starting point
endVector3Ending point
querySettingsNavigationQuerySettingsAdvanced settings to be provided to the navigation mesh query
Returns
- NavigationRaycastResult
The found raycast hit if Hit is true
Raycast(Vector3, NavigationQuerySettings)
Performs a raycast on the navigation mesh to perform line of sight or similar checks. Starts from the entity's current world position
public NavigationRaycastResult Raycast(Vector3 end, NavigationQuerySettings querySettings)
Parameters
endVector3Ending point
querySettingsNavigationQuerySettingsAdvanced settings to be provided to the navigation mesh query
Returns
- NavigationRaycastResult
The found raycast hit if Hit is true
TryFindPath(Vector3, Vector3, IList<Vector3>)
Finds a path from point to
public bool TryFindPath(Vector3 start, Vector3 end, IList<Vector3> path)
Parameters
startVector3The starting location of the pathfinding query
endVector3The ending location of the pathfinding query
pathIList<Vector3>The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)
Returns
- bool
True if a valid path was found
TryFindPath(Vector3, Vector3, IList<Vector3>, NavigationQuerySettings)
Finds a path from point to
public bool TryFindPath(Vector3 start, Vector3 end, IList<Vector3> path, NavigationQuerySettings querySettings)
Parameters
startVector3The starting location of the pathfinding query
endVector3The ending location of the pathfinding query
pathIList<Vector3>The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)
querySettingsNavigationQuerySettingsAdvanced settings to be provided to the navigation mesh query
Returns
- bool
True if a valid path was found
TryFindPath(Vector3, IList<Vector3>)
Finds a path from the entity's current location to
public bool TryFindPath(Vector3 end, IList<Vector3> path)
Parameters
endVector3The ending location of the pathfinding query
pathIList<Vector3>The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)
Returns
- bool
The found path points or null
TryFindPath(Vector3, IList<Vector3>, NavigationQuerySettings)
Finds a path from the entity's current location to
public bool TryFindPath(Vector3 end, IList<Vector3> path, NavigationQuerySettings querySettings)
Parameters
endVector3The ending location of the pathfinding query
pathIList<Vector3>The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)
querySettingsNavigationQuerySettingsAdvanced settings to be provided to the navigation mesh query
Returns
- bool
True if a valid path was found