weapon timings

main
Twirpytherobot 1 week ago
parent 7d18de1621
commit ddc1522174
  1. 2
      level/resources/weapon_testsword.tres
  2. 9
      level/scripts/base_weapon.gd

@ -12,6 +12,6 @@ attack_range = 3.5
attack_cooldown = 0.6
knockback_force = 12.0
startup_time = 0.12
active_time = 0.2
active_time = 1.0
mesh_scene = ExtResource("1_gdc1w")
weight = 2.0

@ -159,11 +159,14 @@ func _activate_hitbox():
# Update owner reference in case it changed
_hitbox.owner_entity = owner_character
# Activate hitbox immediately for entire animation duration
# Activate hitbox immediately for the duration specified in weapon data
_hitbox.activate()
# Keep active for the full attack cooldown
var duration = weapon_data.attack_cooldown if weapon_data else 0.5
# Calculate total active duration from weapon resource (startup + active)
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
# Deactivate when attack is complete

Loading…
Cancel
Save