Skip to main content

find_node_by_pattern

Function find_node_by_pattern 

Source
pub fn find_node_by_pattern(
    base_node: &Gd<Node>,
    pattern: &str,
) -> Option<Gd<Node>>
Expand description

Find a node by matching a pattern with wildcards.

Supports patterns like:

  • /root/*/HUD/CurrentLevel - matches any single node name where * appears
  • /root/Level*/HUD/CurrentLevel - matches node names starting with “Level”
  • */HUD/CurrentLevel - matches relative to the base node