weapon timings
This commit is contained in:
@@ -12,6 +12,6 @@ attack_range = 3.5
|
|||||||
attack_cooldown = 0.6
|
attack_cooldown = 0.6
|
||||||
knockback_force = 12.0
|
knockback_force = 12.0
|
||||||
startup_time = 0.12
|
startup_time = 0.12
|
||||||
active_time = 0.2
|
active_time = 1.0
|
||||||
mesh_scene = ExtResource("1_gdc1w")
|
mesh_scene = ExtResource("1_gdc1w")
|
||||||
weight = 2.0
|
weight = 2.0
|
||||||
|
|||||||
@@ -159,11 +159,14 @@ func _activate_hitbox():
|
|||||||
# Update owner reference in case it changed
|
# Update owner reference in case it changed
|
||||||
_hitbox.owner_entity = owner_character
|
_hitbox.owner_entity = owner_character
|
||||||
|
|
||||||
# Activate hitbox immediately for entire animation duration
|
# Activate hitbox immediately for the duration specified in weapon data
|
||||||
_hitbox.activate()
|
_hitbox.activate()
|
||||||
|
|
||||||
# Keep active for the full attack cooldown
|
# Calculate total active duration from weapon resource (startup + active)
|
||||||
var duration = weapon_data.attack_cooldown if weapon_data else 0.5
|
var startup = weapon_data.startup_time if weapon_data else 0.15
|
||||||
|
var active = weapon_data.active_time if weapon_data else 0.2
|
||||||
|
var duration = startup + active
|
||||||
|
|
||||||
await get_tree().create_timer(duration).timeout
|
await get_tree().create_timer(duration).timeout
|
||||||
|
|
||||||
# Deactivate when attack is complete
|
# Deactivate when attack is complete
|
||||||
|
|||||||
Reference in New Issue
Block a user