Skip to main content

AgentFollowSettings

A class in Root.Township, Alta.Intelligence.

Settings for ActiveFollow: chase the target with the pathfinder until close, giving up past a distance unless the target has hurt the creature enough. Server only.

Constructors​

MemberWhat it is
AgentFollowSettings()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private float giveUpDistanceBacking field for GiveUpDistance (default -1, so any path length counts as too far).
private float giveUpHurtMaximumBacking field for GiveUpHurtMaximum (default 0).
private float targetReachedDistanceBacking field for TargetReachedDistance (default 0.1).
private float targetReachedRandomExtraBacking field for TargetReachedRandomExtra.

Properties​

MemberWhat it is
float GiveUpDistance { get; }The action cancels when the remaining path is longer than this and the target's hurt is at most GiveUpHurtMaximum.
float GiveUpHurtMaximum { get; }A target whose Hurt value is above this is never given up on for distance.
float TargetReachedDistance { get; }Distance from the target that counts as reached and finishes the action (unless overshooting).
float TargetReachedRandomExtra { get; }Up to this much random extra is added to TargetReachedDistance each time the action starts.

Methods​

MemberWhat it is
protected override IAction GetAction()Builds the shared ActiveFollow action, which uses a target.