This commit is contained in:
2025-01-28 14:35:32 +08:00
parent 9640283964
commit 5a9092adfc
5 changed files with 29 additions and 7 deletions
+3 -2
View File
@@ -273,12 +273,13 @@ func create_bot(bot_id):
var bot_character = player_scene.instantiate()
bot_character.set_multiplayer_authority(1)
bot_character.name = str(bot_id)
bot_character.is_bot = true # Set bot flag
add_child(bot_character)
bot_character.add_to_group("Players", true)
bot_character.add_to_group("Bots", true)
# The BehaviorTree will auto-activate for bots
var behavior_tree = bot_character.get_node_or_null("BotBehavior")
# Get behavior tree reference
var behavior_tree = bot_character.get_node_or_null("BehaviorTree")
if behavior_tree:
behavior_tree.enabled = true
behavior_tree.actor = bot_character