Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | AstroBlox_ |
I am trying to play a death animation when the player hits the enemy. But I am getting this error Invalid call. Nonexistent function ‘die’ in base ‘KinematicBody2D (enimy.gd)’.
even though the player’s script have a function.HELP! PLS
func _on_Area2D2_body_entered(body):
body.die()
Die function in player:
func die():
var player = load("res://Player.tscn")
player.get_node("AnimationPlayer").play("die")
$Timer.start()