File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
addons/yet_another_behavior_tree/src/Nodes Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ signal on_idle()
30
30
@export var actor_path :NodePath :
31
31
set (value ):
32
32
actor_path = value
33
+ _update_actor_from_path ()
33
34
update_configuration_warnings ()
34
35
35
36
@export var blackboard :BTBlackboard = null :
@@ -111,13 +112,16 @@ func _check_direct_children_validity() -> bool:
111
112
func _check_actor_validity () -> bool :
112
113
var is_valid :bool = actor_path != null and not actor_path .is_empty ()
113
114
if is_valid :
114
- _actor = get_node_or_null (actor_path )
115
- if not is_instance_valid (_actor ) and is_inside_tree ():
116
- # Fallback : si le chemin donné n'était pas relatif à la scene courante, on le check en absolu
117
- _actor = get_tree ().current_scene .get_node_or_null (actor_path )
115
+ _update_actor_from_path ()
118
116
is_valid = _actor != null and is_instance_valid (_actor )
119
117
return is_valid
120
118
119
+ func _update_actor_from_path () -> void :
120
+ _actor = get_node_or_null (actor_path )
121
+ if not is_instance_valid (_actor ) and is_inside_tree ():
122
+ # Fallback : si le chemin donné n'était pas relatif à la scene courante, on le check en absolu
123
+ _actor = get_tree ().current_scene .get_node_or_null (actor_path )
124
+
121
125
func _do_execute (delta :float ):
122
126
_register_execution_start ()
123
127
_blackboard .set_data ("delta" , delta )
You can’t perform that action at this time.
0 commit comments