ai refactoring
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
extends State
|
||||
|
||||
const IDLE_STATE_ID: StringName = &"idle"
|
||||
|
||||
@onready var agent: AIBase = owner
|
||||
|
||||
func enter() -> void:
|
||||
run_animation()
|
||||
agent.navigate_to_random_point()
|
||||
agent.run_walking_animation()
|
||||
|
||||
func physics_update(_delta) -> void:
|
||||
if agent.nav_agent.is_navigation_finished():
|
||||
transitioned.emit(self, IDLE_STATE_ID)
|
||||
transitioned.emit(self, next_state_id)
|
||||
|
||||
Reference in New Issue
Block a user