![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | NotGoodatGodot |
So i have a problem with the hit animation.
I can´t play the hit animation when i hit the enemy.
I have this code for the enemy (for his death):
func dead():
vida -= 1
if vida <= 0:
is_dead = true
velocidade = Vector2(0,0)
$AnimatedSprite.play("morte inimigo1")
$CollisionShape2D.set_deferred("disabled",true)
$Timer.start()
and this one for the “damagebox”
func _on_damagebox_body_entered(body):
if "inimigo1" in body.name:
body.dead()
what can i do so when i hit the enemy a “hit” animation plays?
Pls help