Skip to main content

AgentThreatenSettings

A class in Root.Township, Alta.Intelligence.

Settings for ActiveThreaten: face the target for a random time, switching to another action set if it comes close and cancelling if it goes far. Server only.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private float cancelDistanceBacking field for CancelDistance (default 10).
private ActionComponentSet changeToBacking field for ChangeTo.
private float instantDistanceBacking field for InstantDistance (default 0).
private bool isFacingBacking field for IsFacing (default true).

Properties​

MemberWhat it is
float CancelDistance { get; }The action cancels when the target is further than this.
ActionComponentSet ChangeTo { get; }Action set the creature switches to when the action finishes, whether by timeout or the target coming within InstantDistance.
float InstantDistance { get; }The action finishes at once when the target comes closer than this.
bool IsFacing { get; }Whether the creature turns to face the target while threatening.

Methods​

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