Scripting API

Scripting API

Navigation3D

Class in Abyss.Navigation, from Abyss.Navigation.

The navmeshes a world's surfaces were baked as, loaded as each NavMeshSurface3D appears and let go of as it goes, and asked for a path, the closest point or a straight walk on the one of an agent type: world.Navigation3D().FindPath(from, to).

public sealed class Navigation3D : IDisposable

Remarks

Of an agent type, as Project Settings ▸ Navigation lists them, the first by default. Where several surfaces are baked for it, a question is asked of the first whose navmesh the start is on.

Safe from systems running in parallel: each navmesh is asked one question at a time.

Properties

Walking

public int Walking { get; }

How many agents walk a navmesh while the game plays.

Carved

public int Carved { get; }

How many obstacles are cut out of a navmesh while the game plays.

Version

public int Version { get; }

Moves on whenever a navmesh is loaded or let go of: what something drawing them follows.

Surfaces

public IReadOnlyList<(ulong Surface, int AgentType)> Surfaces { get; }

The surfaces whose navmeshes are loaded, with the agent type each is for.

Methods

PathOf

public int PathOf(ulong agent, Span<Vector3> corners)

The corners of the path the agent on agent walks while the game plays, from where it is to where it was sent, into corners.

Parameters

  • agent
  • corners

Returns How many; none where it walks nowhere, or the game is not playing.

FindPath

public NavPath3D FindPath(Vector3 from, Vector3 to, int agentType = 0, int areaMask = -1)

A path on the navmesh of agentType from from to to, crossing only the areas areaMask ticks; NavPath3D.None where none is loaded or either end is not on one.

Parameters

  • from
  • to
  • agentType
  • areaMask

ClosestPoint

public bool ClosestPoint(Vector3 point, out Vector3 closest, int agentType = 0)

The point of the navmesh of agentType closest to point.

Parameters

  • point
  • closest
  • agentType

Returns Whether one is that close.

Raycast

public bool Raycast(Vector3 from, Vector3 to, out Vector3 hit, int agentType = 0)

Walks straight on the navmesh of agentType from from toward to: where a wall stops it, in hit.

Parameters

  • from
  • to
  • hit
  • agentType

Returns Whether something stops it short.

With

public bool With(ulong surface, Action<NavMesh3D> use)

Has use read the navmesh surface was baked as, with it held so nothing lets go of it meanwhile.

Parameters

  • surface
  • use

Returns Whether one is loaded for it.

Forget

public void Forget(ulong surface)

Has the navmesh of surface read again as it is next seen: what a bake does.

Parameters

  • surface

Dispose

public void Dispose()

Lets go of every navmesh.