mirror of
https://github.com/GDQuest/godot-platformer-2d.git
synced 2026-01-23 02:14:19 +00:00
Fix incorrect signal connection on the hook
The signal should be one shot as it is the trigger to get out of the hook's fire state. I also moved the signal as the cooldown timer doesn't start if the player is not using the hook on a target.
This commit is contained in:
parent
9e1797dd3a
commit
a281242b16
1 changed files with 1 additions and 6 deletions
|
|
@ -6,8 +6,6 @@ func _on_Cooldown_timeout() -> void:
|
|||
|
||||
|
||||
func enter(msg: Dictionary = {}) -> void:
|
||||
owner.cooldown.connect("timeout", self, "_on_Cooldown_timeout")
|
||||
|
||||
owner.is_aiming = false
|
||||
|
||||
var target: HookTarget = owner.snap_detector.target
|
||||
|
|
@ -20,10 +18,7 @@ func enter(msg: Dictionary = {}) -> void:
|
|||
owner.arrow.hook_position = target.global_position
|
||||
target.hooked_from(owner.global_position)
|
||||
|
||||
owner.cooldown.connect("timeout", self, "_on_Cooldown_timeout", [], CONNECT_ONESHOT)
|
||||
owner.cooldown.start()
|
||||
|
||||
owner.emit_signal("hooked_onto_target", target.global_position)
|
||||
|
||||
|
||||
func exit() -> void:
|
||||
owner.cooldown.disconnect("timeout", self, "_on_Cooldown_timeout")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue