Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    NavigationComponent Class

    Namespace: Stride.Navigation
    Assembly: Stride.Navigation.dll

    This is used to interface with the navigation mesh. Supports TryFindPath and Raycast

    System.Object → EntityComponent → NavigationComponent
    Derived from NavigationComponent:

    [DataContract("NavigationComponent")]
    [Display("Navigation", null, Expand = ExpandRule.Once)]
    [ComponentOrder(20000)]
    [DefaultEntityComponentProcessor(typeof(NavigationProcessor), ExecutionMode = ExecutionMode.Runtime)]
    [ComponentCategory("Navigation")]
    public class NavigationComponent : EntityComponent, IIdentifiable
    Name Description
    Properties
    GroupId

    The navigation mesh group to use

    NavigationMesh

    The navigation mesh which is being used. Setting this to null will load the dynamic navigation mesh for the current game (if enabled)

    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

    Raycast(Vector3, Vector3)

    Performs a raycast on the navigation mesh to perform line of sight or similar checks.

    Raycast(Vector3, Vector3, NavigationQuerySettings)

    Performs a raycast on the navigation mesh to perform line of sight or similar checks

    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

    TryFindPath(Vector3, Vector3, IList<Vector3>)

    Finds a path from point to

    TryFindPath(Vector3, Vector3, IList<Vector3>, NavigationQuerySettings)

    Finds a path from point to

    TryFindPath(Vector3, IList<Vector3>)

    Finds a path from the entity's current location to

    TryFindPath(Vector3, IList<Vector3>, NavigationQuerySettings)

    Finds a path from the entity's current location to

    | Improve this Doc View Source

    Properties


    GroupId

    The navigation mesh group to use

    [DataMember(20)]
    [Display("Group", null)]
    public Guid GroupId { get; set; }
    Property Value
    Type Description
    System.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
    Type Description
    NavigationMesh
    | Improve this Doc View Source

    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
    Type Name Description
    Vector3 end

    Ending point

    Returns
    Type Description
    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
    Type Name Description
    Vector3 start

    Starting point

    Vector3 end

    Ending point

    Returns
    Type Description
    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
    Type Name Description
    Vector3 start

    Starting point

    Vector3 end

    Ending point

    NavigationQuerySettings querySettings

    Advanced settings to be provided to the navigation mesh query

    Returns
    Type Description
    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
    Type Name Description
    Vector3 end

    Ending point

    NavigationQuerySettings querySettings

    Advanced settings to be provided to the navigation mesh query

    Returns
    Type Description
    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
    Type Name Description
    Vector3 start

    The starting location of the pathfinding query

    Vector3 end

    The ending location of the pathfinding query

    System.Collections.Generic.IList<Vector3> path

    The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)

    Returns
    Type Description
    System.Boolean

    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
    Type Name Description
    Vector3 start

    The starting location of the pathfinding query

    Vector3 end

    The ending location of the pathfinding query

    System.Collections.Generic.IList<Vector3> path

    The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)

    NavigationQuerySettings querySettings

    Advanced settings to be provided to the navigation mesh query

    Returns
    Type Description
    System.Boolean

    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
    Type Name Description
    Vector3 end

    The ending location of the pathfinding query

    System.Collections.Generic.IList<Vector3> path

    The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)

    Returns
    Type Description
    System.Boolean

    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
    Type Name Description
    Vector3 end

    The ending location of the pathfinding query

    System.Collections.Generic.IList<Vector3> path

    The resulting collection of waypoints for the found path, if any (at least 2 if a path was found)

    NavigationQuerySettings querySettings

    Advanced settings to be provided to the navigation mesh query

    Returns
    Type Description
    System.Boolean

    True if a valid path was found


    Inherited Members

    EntityComponent.Entity
    EntityComponent.Id
    EntityComponent.EnsureEntity

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation