Skip to main content

ActiveCircleTarget

A class in Root.Township, Alta.Intelligence.

Server: running action that walks a creature in a circle around its target at a set distance, for a random duration. Settings come from AgentCircleTargetSettings.

Constructors​

MemberWhat it is
ActiveCircleTarget()Creates an ActiveCircleTarget with default values.

Fields​

2 private and internal fields
MemberWhat it is
private bool isMovingRightWhich way the creature circles.
private Vector3 movingTowardsThe current circle point being walked to.

Methods​

MemberWhat it is
override void Update(bool hasTarget)Faces the target and walks to the next circle point when the last walk ends. Finishes if blocked or too far from the target.
protected override void OnStart()Picks a random side, flips it if a wall is in the way, and finishes if both sides are blocked.
2 private and internal methods
MemberWhat it is
private void Clean(IActiveAction finished)Unhooks the end events and clears the walker's forward facing flag.
private bool GetPosition(Vector3 targetPosition, Vector3 topicPosition, Vector3 toPosition, ref Vector3 intendedPosition)Finds the next point on the circle around the target, checking for walls and ground. False if the way is blocked.