godot-plateformer/_player/states/hook_shooting.gd

26 lines
520 B
GDScript3
Raw Normal View History

2025-12-29 11:54:31 +08:00
extends LimboState
@export var grap_hook_shooting_time: float
var _timer: float
func _enter() -> void:
agent.locomotion_comp.suspend_movement()
agent.locomotion_comp.stop_dash(true)
agent.spawn_hook_comp.spawn_grap_hook_inst()
agent.spawn_hook_comp.grap_reach_target(grap_hook_shooting_time)
_timer = grap_hook_shooting_time
func _update(delta: float) -> void:
if _timer <= 0:
self.dispatch(self.EVENT_FINISHED)
_timer -= delta
func _exit() -> void:
#agent.locomotion_comp.enable_movement()
pass