diff --git a/Scripts/hiro_ai.gd b/Scripts/hiro_ai.gd index 182b642..03a1567 100644 --- a/Scripts/hiro_ai.gd +++ b/Scripts/hiro_ai.gd @@ -132,6 +132,8 @@ func _on_animation_tree_animation_finished(anim_name): state_machine.send_event("hurt_complete") elif (anim_name.contains("kick") or anim_name.contains("punch")): if wants_to_melee: + var animation_rng = randf_range(0, 1) + anim_tree.set("parameters/melee/blend_position", animation_rng) anim_tree.set("parameters/conditions/melee", true) else: state_machine.send_event("melee_complete") @@ -183,8 +185,8 @@ func _on_meleebox_body_entered(body): state_machine.send_event("will_melee") func _on_melee_state_entered(): - state_machine.set_expression_property("melee_stage", 0) anim_tree.set("parameters/conditions/melee", true) + state_machine.set_expression_property("melee_stage", 0) func _on_meleebox_body_exited(body): if body == player_character: