Stop depthFirstTraversal & breadthFirstTraversal

Hi all,
im wondering, if im traversing nodes and finding node that tells player’s position (node with name Player) and if found, how can i stop traversing? i dont see any boolean for stopping traversion…

so search must be always on all subnodes of specified node, or im supposed ot stop traversing by throwing exception? isnt it bad?

maybe im supposed to create node players and then search in it

you cant. you could do a check to see if the node was already found and just have the method do nothing if thats the case.

yea but this is wasting resources, but not so horrible, so lets get over it :slight_smile: