Skip to main content

weighted_selector

Function weighted_selector 

Source
pub fn weighted_selector(
    name: &str,
    children: Vec<BehaviorNode>,
    weights: Vec<f32>,
) -> BehaviorNode
Expand description

A Selector that picks exactly one child based on probability weights and ticks only that child. Each activation samples a fresh child.

weights must be the same length as children. Weights need not sum to 1.0 — they are normalized internally.