Skip to main content

melee_attack

Function melee_attack 

Source
pub fn melee_attack(
    name: &str,
    agent_pos_key: &str,
    target_pos_key: &str,
    can_attack_key: &str,
    attack_request_key: &str,
    melee_range: f32,
) -> BehaviorNode
Expand description

Action: perform a melee attack if the target is within melee_range.

Reads:

  • "{agent_pos_key}" — Vec3
  • "{target_pos_key}" — Vec3
  • "{can_attack_key}" — bool

Writes:

  • "{attack_request_key}" — bool true