Add object hit animation

This commit is contained in:
2023-10-07 17:56:15 -07:00
parent 9b1ba976d0
commit 2780797460
3 changed files with 60 additions and 8 deletions

View File

@ -31,6 +31,7 @@ func _process(delta):
var hit_object = $body_pivot/raycast.get_collider()
if hit_object.type == "resource":
inventory[hit_object.resource_type] += 1
hit_object.get_node("animation").play("hit")
#update inventory HUD
$hud/inventory/stone_label.text = str(inventory.stone)