Add simple example of using BTSetVar action

This commit is contained in:
Serhii Snitsaruk 2023-08-07 15:10:25 +02:00
parent c8ec35c798
commit 471a12fec4
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,23 @@
[gd_resource type="BehaviorTree" load_steps=6 format=3 uid="uid://cvm3gqes75f53"]
[sub_resource type="BBVariant" id="BBVariant_cu1uc"]
resource_name = "Hello, World!"
saved_value = "Hello, World!"
type = 4
[sub_resource type="BTSetVar" id="BTSetVar_2e0uw"]
variable = "message"
value = SubResource("BBVariant_cu1uc")
[sub_resource type="BTConsolePrint" id="BTConsolePrint_533ui"]
text = "Message is: %s"
bb_format_parameters = PackedStringArray("message")
[sub_resource type="BTSequence" id="BTSequence_bhar3"]
children = [SubResource("BTSetVar_2e0uw"), SubResource("BTConsolePrint_533ui")]
[sub_resource type="BTRunLimit" id="BTRunLimit_hv3vu"]
children = [SubResource("BTSequence_bhar3")]
[resource]
root_task = SubResource("BTRunLimit_hv3vu")

View File

@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://d4bjeyescflm8"]
[ext_resource type="BehaviorTree" uid="uid://cvm3gqes75f53" path="res://ai/trees/variables.tres" id="1_tq7fc"]
[node name="Variables Example" type="Node2D"]
[node name="BTPlayer" type="BTPlayer" parent="."]
behavior_tree = ExtResource("1_tq7fc")