Skip to main content

AgentIdleSettings

A class in Root.Township, Alta.Intelligence.

Settings for a creature's idle action: how long it lasts, whether it faces or follows its target during set time windows, and a chance to wander to a new spot. Its action is ActiveIdle.

Constructors​

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

Fields​

10 private and internal fields
MemberWhat it is
private float followFromSeconds into the idle after which the agent starts facing its target (-1 means from the start).
private float followMovementFromSeconds into the idle after which the agent starts walking after its target.
private float followMovementToSeconds into the idle after which it stops walking after the target; below 0 means no end.
private float followToSeconds into the idle after which it stops facing the target; below 0 means no end.
private bool isFacingTargetWhether the agent turns to face its target during the idle.
private bool isFollowingMovementWhether the agent walks towards its target during the idle.
private bool isSlowingDownWhenMovingValue given to the walker's IsSlowedWhenNotMoving while following; restored when the idle ends.
private bool isUsingTargetWhether the idle action uses a target at all.
private float moveSpawnChanceChance (0 to 1) that starting the idle asks the agent's population to move it elsewhere.
private float targetReachedDistanceDistance at which following the target counts as reached (default 0.1).

Properties​

MemberWhat it is
float FollowFrom { get; }Seconds into the idle before the creature starts facing its target.
float FollowMovementFrom { get; }Seconds into the idle before the creature starts walking toward its target.
float FollowMovementTo { get; }Seconds into the idle when it stops walking toward its target. -1 means until the end.
float FollowTo { get; }Seconds into the idle when it stops facing its target. -1 means until the end.
bool IsFacingTarget { get; }Whether the creature turns to face its target while idling.
bool IsFollowingMovement { get; }Whether the creature walks toward its target while idling.
bool IsSlowingDownWhenMoving { get; }Value given to the walker's slowed-when-not-moving flag during this idle, restored after.
bool IsUsingTarget { get; }Whether the idle action uses a target at all.
float MoveSpawnChance { get; }Chance (0 to 1) at the start of the idle that a population creature asks its population to move it.
float TargetReachedDistance { get; }How close counts as reaching the target when following it.

Methods​

MemberWhat it is
protected override IAction GetAction()Returns an ActiveIdle action using these settings.

Used in​

Members of other types that take, return or hold a AgentIdleSettings: