extends BeehaveTree func _ready(): if Engine.is_editor_hint(): return # Get parent node safely var parent = get_parent() if not parent: push_error("BehaviorTree: No parent node found") return # Only setup for bots if not parent.is_in_group("Bots"): queue_free() # Remove tree if not a bot return # Set this tree's actor actor = parent # Wait a frame to ensure all nodes are ready await get_tree().process_frame enabled = parent.is_multiplayer_authority() and parent.is_bot