Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | imsolo |
i need a help my punch animation is not working when i press mouse click button
my code :
extends Node2D
@onready var animation = $AnimationPlayer
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _input(event):
if (event is InputEventMouseButton or event is InputEventScreenTouch) and event.is_pressed():
animation.play("punch")