var avoidanceEnabled: BoolIf true the agent is registered for an RVO avoidance callback on the NavigationServer3D. When velocity is set and the processing is completed a safe_velocity Vector3 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
var avoidanceMask: UInt32A bitfield determining what other avoidance agents and obstacles this NavigationAgent will avoid when a bit matches at least one of their avoidanceLayers.
var avoidancePriority: DoubleThe agent does not adjust the velocity for other agents that would match the avoidanceMask but have a lower avoidancePriority. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent.
var debugEnabled: BoolIf true shows debug visuals for this agent.
var debugPathCustomColor: ColorIf debugUseCustom is true uses this color for this agent instead of global color.
var debugPathCustomPointSize: DoubleIf debugUseCustom is true uses this rasterized point size for rendering path points for this agent instead of global point size.
var debugUseCustom: BoolIf true uses the defined debugPathCustomColor for this agent instead of global color.
var height: DoubleThe height of the avoidance agent. Agents will ignore other agents or obstacles that are above or below their current position + height in 2D avoidance. Does nothing in 3D avoidance which uses radius spheres alone.
var keepYVelocity: BoolIf true, and the agent uses 2D avoidance, it will remember the set y-axis velocity and reapply it after the avoidance step. While 2D avoidance has no y-axis and simulates on a flat plane this setting can help to soften the most obvious clipping on uneven 3D geometry.
var linkReached: Signal2Signals that the agent reached a navigation link. Emitted when the agent moves within pathDesiredDistance of the next position of the path when that position is a navigation link.
var maxSpeed: DoubleThe maximum speed that an agent can move.
var navigationFinished: SimpleSignalSignals that the agent’s navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path.
var neighborDistance: DoubleThe distance to search for other agents.
var pathChanged: SimpleSignalEmitted when the agent had to update the loaded path:
var pathDesiredDistance: DoubleThe distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to it leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot the distance to the next point on each physics frame update.
var pathHeightOffset: DoubleThe height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents.
var pathMaxDistance: DoubleThe maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
var pathMetadataFlags: NavigationPathQueryParameters3D.PathMetadataFlagsAdditional information to return with the navigation path.
var pathPostprocessing: NavigationPathQueryParameters3D.PathPostProcessingThe path postprocessing applied to the raw path corridor found by the pathfindingAlgorithm.
var pathfindingAlgorithm: NavigationPathQueryParameters3D.PathfindingAlgorithmThe pathfinding algorithm used in the path query.
var radius: DoubleThe radius of the avoidance agent. This is the “body” of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by neighborDistance).
var simplifyEpsilon: DoubleThe path simplification amount in worlds units.
var simplifyPath: BoolIf true a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by simplifyEpsilon. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation.
var targetDesiredDistance: DoubleThe distance threshold before the target is considered to be reached. On reaching the target, [signal target_reached] is emitted and navigation ends (see isNavigationFinished and [signal navigation_finished]).
var targetPosition: Vector3If set, a new navigation path from the current agent position to the targetPosition is requested from the NavigationServer.
var targetReached: SimpleSignalSignals that the agent reached the target, i.e. the agent moved within targetDesiredDistance of the targetPosition. This signal is emitted only once per loaded path.
var timeHorizonAgents: DoubleThe minimal amount of time for which this agent’s velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive.
var timeHorizonObstacles: DoubleThe minimal amount of time for which this agent’s velocities, that are computed with the collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the number, the sooner the agent will respond to static avoidance obstacles, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive.
var use3dAvoidance: BoolIf true, the agent calculates avoidance velocities in 3D omnidirectionally, e.g. for games that take place in air, underwater or space. Agents using 3D avoidance only avoid other agents using 3D avoidance, and react to radius-based avoidance obstacles. They ignore any vertex-based obstacles.
var velocity: Vector3Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use setVelocityForced(velocity:) as well to reset the internal simulation velocity.
var velocityComputed: Signal3Notifies when the collision avoidance velocity is calculated. Emitted every update as long as avoidanceEnabled is true and the agent has a navigation map.
var waypointReached: Signal1Signals that the agent reached a waypoint. Emitted when the agent moves within pathDesiredDistance of the next position of the path.
func distanceToTarget() -> DoubleReturns the distance to the target position, using the agent’s global position. The user must set targetPosition in order for this to be accurate.
func getAvoidanceLayerValue(layerNumber: Int32) -> BoolReturns whether or not the specified layer of the avoidanceLayers bitmask is enabled, given a layerNumber between 1 and 32.
func getAvoidanceMaskValue(maskNumber: Int32) -> BoolReturns whether or not the specified mask of the avoidanceMask bitmask is enabled, given a maskNumber between 1 and 32.
func getCurrentNavigationPath() -> PackedVector3ArrayReturns this agent’s current path from start to finish in global coordinates. The path only updates when the target position is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended getNextPathPosition once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic.
func getCurrentNavigationPathIndex() -> Int32Returns which index the agent is currently on in the navigation path’s PackedVector3Array.
func getCurrentNavigationResult() -> NavigationPathQueryResult3D?Returns the path query result for the path the agent is currently following.
func getFinalPosition() -> Vector3Returns the reachable final position of the current navigation path in global coordinates. This position can change if the agent needs to update the navigation path which makes the agent emit the [signal path_changed] signal.
func getNavigationLayerValue(layerNumber: Int32) -> BoolReturns whether or not the specified layer of the navigationLayers bitmask is enabled, given a layerNumber between 1 and 32.
func getNavigationMap() -> RIDReturns the RID of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use setNavigationMap(_:) to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer.
func getNextPathPosition() -> Vector3Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent’s parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent.
func getRid() -> RIDReturns the RID of this agent on the NavigationServer3D.
func isNavigationFinished() -> BoolReturns true if the agent’s navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached.
func isTargetReachable() -> BoolReturns true if getFinalPosition is within targetDesiredDistance of the targetPosition.
func isTargetReached() -> BoolReturns true if the agent reached the target, i.e. the agent moved within targetDesiredDistance of the targetPosition. It may not always be possible to reach the target but it should always be possible to reach the final position. See getFinalPosition.
func setAvoidanceLayerValue(layerNumber: Int32, value: Bool)Based on value, enables or disables the specified layer in the avoidanceLayers bitmask, given a layerNumber between 1 and 32.
func setAvoidanceMaskValue(maskNumber: Int32, value: Bool)Based on value, enables or disables the specified mask in the avoidanceMask bitmask, given a maskNumber between 1 and 32.
func setNavigationLayerValue(layerNumber: Int32, value: Bool)Based on value, enables or disables the specified layer in the navigationLayers bitmask, given a layerNumber between 1 and 32.
func setNavigationMap(RID)Sets the RID of the navigation map this NavigationAgent node should use and also updates the agent on the NavigationServer.
func setVelocityForced(velocity: Vector3)Replaces the internal velocity in the collision avoidance simulation with velocity. When an agent is teleported to a new position this function should be used in the same frame. If called frequently this function can get agents stuck.