Skip to main content

ActiveJumpAt

A class in Root.Township, Alta.Intelligence.

Action where the agent leaps at its target with set velocity and gravity, finishing when it lands. Tells an IJumpAttacker agent it is jumping.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private float gravityThe walker's gravity multiplier before the jump, restored after.
private IJumpAttacker jumpAttackerThe agent as an IJumpAttacker, or null.
private Quaternion targetRotationFlat rotation towards the target, held during the jump.
private bool wasJumpingWhether the agent has left the ground yet.

Methods​

MemberWhat it is
override void Update(bool hasTarget)Keeps facing the target and finishes once the agent touches ground after being in the air.
protected override void OnStart()Launches the agent at the target, lowers gravity, faces it and sets the action's duration.
1 private and internal method
MemberWhat it is
private void HandleFinished(IActiveAction active)Restores walker power and gravity, clears facing and tells the jump attacker the jump is over.