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
-
NavigationComponent
- 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
end
Vector3Ending 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
start
Vector3Starting point
end
Vector3Ending point
querySettings
NavigationQuerySettingsAdvanced 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
end
Vector3Ending point
querySettings
NavigationQuerySettingsAdvanced 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
start
Vector3The starting location of the pathfinding query
end
Vector3The ending location of the pathfinding query
path
IList<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
start
Vector3The starting location of the pathfinding query
end
Vector3The ending location of the pathfinding query
path
IList<Vector3>The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)
querySettings
NavigationQuerySettingsAdvanced 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
end
Vector3The ending location of the pathfinding query
path
IList<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
end
Vector3The ending location of the pathfinding query
path
IList<Vector3>The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)
querySettings
NavigationQuerySettingsAdvanced settings to be provided to the navigation mesh query
Returns
- bool
True if a valid path was found