Table of Contents

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

Guid

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

NavigationMesh

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 Vector3

Ending 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

start Vector3

Starting point

end Vector3

Ending point

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 Vector3

Starting point

end Vector3

Ending point

querySettings NavigationQuerySettings

Advanced 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 Vector3

Ending point

querySettings NavigationQuerySettings

Advanced 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 Vector3

The starting location of the pathfinding query

end Vector3

The 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 Vector3

The starting location of the pathfinding query

end Vector3

The 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 NavigationQuerySettings

Advanced 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 Vector3

The 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 Vector3

The 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 NavigationQuerySettings

Advanced settings to be provided to the navigation mesh query

Returns

bool

True if a valid path was found