On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

guys i need help

A topic by The Ungodly God created Feb 15, 2022 Views: 99 Replies: 2
Viewing posts 1 to 2
Submitted

 how to play the death animation and then kill the enemy. please check my code and help .

func _process(delta):

if health <= 0:

$death_timer.start()

$AnimationPlayer.play("death")


func _on_death_timer_timeout(): # this is a signal timeout

queue_free()

please help

Submitted

Piece of cake ! In your "Death" animation, you can call a function (queue_free for exemple). Just add a track  "Call method track" and insert a "key frame" that calls the desired function.

No need for a death_timer

Submitted (1 edit)

OK i will try

Thank you