Skip to main content

Dot

A Dot Condition calculates the dot product of two Vector Stats and evaluates the result using a comparison condition.

Fields​

FieldDescription
ComparerThe Numerable Comparer used to evaluate the calculated dot product.

Supported Types​

  • Vector2
  • Vector3
  • Vector2Int
  • Vector3Int

Example​

Two facing directions, compared with Dot: attacker facing (0, 0, 1), target facing (0, 0, 1) gives 1 (they face the same way); target facing (0, 0, −1) gives −1 (they face each other). A Greater Or Equal 0.5 comparer passes when the two face roughly the same way.

Kodes' melee deflect uses Dot this way: the player's facing Direction against a projectile's flight Direction (Condition_ProjectileIncoming_R3D, Lower Or Equal 0), so only a shot flying at the player's front is deflected — one flying the same way as the player (fired from behind, or flying away after passing) is not. The projectile's Direction Stat is kept in sync with its transform by an Actor Extension (ActorExtension_TransformToDirectionStat_Vector3).

Behind, in front, at a side

Dot compares facings, not positions: it can't tell whether an attacker stands behind its target (an attacker in front of the target but facing away faces the same way too). For where an Actor is, use Relative Angle — Backstab and Rusty Pan use it.