Skip to main content

BasicActiveAgentMoveCloser<T>

An abstract class in Root.Township, Alta.Intelligence.

Base for running actions that move a creature straight at its target without pathfinding. Faces the target each tick, cancels if it's lost or too far, and leaves the movement to the subclass. Server only.

Constructors​

MemberWhat it is
protected BasicActiveAgentMoveCloser()Creates a BasicActiveAgentMoveCloser with default values.

Fields​

MemberWhat it is
protected Func<float> getSpeedMultiplierReturns the creature's current "speed" stat value, or 1. Set in OnStart.

Methods​

MemberWhat it is
override void Update(bool hasTarget)Each tick: cancels without a target or past MaxDistanceBeforeCancelSquared, turns the body to the target, then calls the abstract overload with the offset to the stopping point.
protected override void OnStart()Picks up the creature's "speed" stat as a speed multiplier, or 1 if it has none.
protected abstract void Update(Vector3 position, Vector3 targetPosition, Vector3 toTargetXZ, Vector3 toEdge, float flatDistance)Each tick: cancels without a target or past MaxDistanceBeforeCancelSquared, turns the body to the target, then calls the abstract overload with the offset to the stopping point.