Repository navigation
API Class NavAgent
Defined in: src/plugins/navigation/runtime/components.ts:184
A navigation agent: walks, flies or both by its agent type, avoiding other agents. With updatePosition /
updateRotation off, the node is left alone (drive it yourself from desiredVelocity).
new NavAgent(): NavAgent;NavAgent
agentType: string = "";Defined in: src/plugins/navigation/runtime/components.ts:186
The agent type's id (project settings); "" = the first type.
areaCosts: Record<string, number | "excluded"> = {};Defined in: src/plugins/navigation/runtime/components.ts:196
Per-area costs over the type's: { areaId: cost | "excluded" }.
chaseGoal: boolean = false;Defined in: src/plugins/navigation/runtime/components.ts:200
Chase initialGoal (follow it as it moves) instead of going to where it is once.
chaseRepathDistance: number = 1;Defined in: src/plugins/navigation/runtime/components.ts:202
While chasing initialGoal: plan a new path once it has moved this far (metres).
initialGoal: GameObject | null = null;Defined in: src/plugins/navigation/runtime/components.ts:198
Where the agent heads as soon as it starts (Foxfire's NavAgentAuthoring InitialGoal); null = nowhere.
priority: number = -1;Defined in: src/plugins/navigation/runtime/components.ts:194
Avoidance priority; −1 = the type's. (Avoidance layers are the type's, as in Foxfire.)
speed: number = 0;Defined in: src/plugins/navigation/runtime/components.ts:188
0 = the type's.
turnSpeed: number = 0;Defined in: src/plugins/navigation/runtime/components.ts:190
0 = the type's.
updatePosition: boolean = true;Defined in: src/plugins/navigation/runtime/components.ts:191
updateRotation: boolean = true;Defined in: src/plugins/navigation/runtime/components.ts:192
get desiredVelocity(): Vector3;Defined in: src/plugins/navigation/runtime/components.ts:249
The velocity the agent wants (before avoidance limits; what to drive a node with). A copy.
get enabled(): boolean;Defined in: src/engine/core/Component.ts:63
boolean
set enabled(value): void;Defined in: src/engine/core/Component.ts:67
boolean
void
get gameObject(): GameObject;Defined in: src/engine/core/Component.ts:43
Unity-style alias for node.
get isActiveAndEnabled(): boolean;Defined in: src/engine/core/Component.ts:74
True when enabled, the node is active in the hierarchy, and the node is in a loaded world.
boolean
get isWaitingForChunk(): boolean;Defined in: src/plugins/navigation/runtime/components.ts:260
True while the agent waits for its chunk to load.
boolean
get mode(): NavMode;Defined in: src/plugins/navigation/runtime/components.ts:238
get node(): GameObject;Defined in: src/engine/core/Component.ts:38
The node this component is on.
get owner(): GameObject;Defined in: src/engine/core/Component.ts:51
The node this component acts for: the node itself when attached directly, or the parent node when this component lives on a component node (ADR 0009).
get path(): NavWaypoint[];Defined in: src/plugins/navigation/runtime/components.ts:265
The current path's waypoints (empty without one).
get pathState(): NavPathState;Defined in: src/plugins/navigation/runtime/components.ts:234
get remainingDistance(): number;Defined in: src/plugins/navigation/runtime/components.ts:255
Distance left along the path.
number
get time(): Readonly<TimeState>;Defined in: src/engine/core/Component.ts:99
This component's World's clock (ADR 0032): the same values as Time, but safe to read
outside the World's frame too (after an await, say).
Readonly<TimeState>
get transform(): Transform;Defined in: src/engine/core/Component.ts:57
The Transform of the node this component is on, if it has one.
get velocity(): Vector3;Defined in: src/plugins/navigation/runtime/components.ts:243
Velocity in the last step (units/s). A copy.
get world(): WorldHandle;Defined in: src/engine/core/Component.ts:88
A handle on this component's World (ADR 0132): the same one Engine.findWorld returns. Load
a scene into it, pause, connect or destroy it: this.world.loadScene("scenes/level2.scene.json").
Throws for a World no Engine owns.
chase(node, repathDistance?): void;Defined in: src/plugins/navigation/runtime/components.ts:219
Follows node (another agent, a NavSurround / NavFlowGoal target, or any node), planning a new path whenever
it has moved repathDistance metres (default 1) from where the current path ends.
number = 1
void
instantiate(prefabPath, options?): GameObject;Defined in: src/engine/core/Component.ts:109
Instantiate a prefab in this component's World (ADR 0034), like GameObject.instantiate.
Use it in code that may run after an await: by then the frame is over and the current World
is the Engine's default one, which may not be this component's. A parent from another
World throws.
string
InstantiateOptions = {}
setDestination(point): void;Defined in: src/plugins/navigation/runtime/components.ts:211
Plans a path to point and follows it.
void
stop(): void;Defined in: src/plugins/navigation/runtime/components.ts:225
Drops the path or chase and stops.
void
warp(point): void;Defined in: src/plugins/navigation/runtime/components.ts:230
Moves the agent to point at once (snapped to the navmesh), dropping its path.
void
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference