Behavior Tree addon

This commit is contained in:
Tony Bark 2023-01-21 04:04:13 -05:00
parent 5de5a0c315
commit 5fa863114a
50 changed files with 1762 additions and 3 deletions

View file

@ -0,0 +1,18 @@
extends Composite
class_name SequenceComposite, "../../icons/sequencer.svg"
func tick(actor, blackboard):
for c in get_children():
var response = c.tick(actor, blackboard)
if c is ConditionLeaf:
blackboard.set("last_condition", c)
blackboard.set("last_condition_status", response)
if response != SUCCESS:
if c is ActionLeaf and response == RUNNING:
blackboard.set("running_action", c)
return response
return SUCCESS