extends Node3D
var animation_player = null
var animation_playing = false
var target_animation = "MakeHuman default skeleton|pistolaenmanodisparando"
func _ready():
# Obtener una referencia al nodo AnimationPlayer
animation_player = $AnimationPlayer
# Reproducir la animación si existe
animation_player.play(target_animation)
animation_playing = true
func _process(delta):
# Controlar la reproducción de la animación con la tecla "u"
if Input.is_action_pressed("paraanimacion"):
if animation_playing:
# Detener la animación
animation_player.stop()
animation_playing = false
elif Input.is_action_just_released("paraanimacion"):
if not animation_playing:
# Reanudar la animación
animation_player.play(target_animation)
animation_playing = true