10 lines
247 B
GDScript
10 lines
247 B
GDScript
extends BTCondition
|
|
class_name NearEnemy
|
|
|
|
@export var player_detection_distance:int = 50
|
|
|
|
func tick(actor:Node2D, _blackboard:BTBlackboard) -> int:
|
|
if actor.enemies_in_range.size() > 0:
|
|
return BTTickResult.SUCCESS
|
|
return BTTickResult.FAILURE
|