Files
tgcc/core/ai/framework/patrol_state.gd

13 lines
340 B
GDScript

extends State
func enter() -> void:
super.enter()
run_animation()
agent.navigate_to_random_point()
func physics_update(_delta) -> void:
if agent.nav_agent.is_navigation_finished():
transitioned.emit(self, get_next_state())
elif agent.nav_agent.get_current_navigation_path().is_empty():
transitioned.emit(self, get_next_state())